| Summary: | ArchiveHandlerManager#cleanUpVirtualPath is messing up the file separators | ||
|---|---|---|---|
| Product: | [Tools] Target Management | Reporter: | Radoslav Gerganov <rgerganov> |
| Component: | RSE | Assignee: | Xuan Chen <xuanchen> |
| Status: | CLOSED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> |
| Severity: | major | ||
| Priority: | P1 | ||
| Version: | 2.0 | ||
| Target Milestone: | 3.0 M5 | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 220256 | ||
Sorry, I meant that the method returns the original path if it doesn't contain VIRTUAL_CANONICAL_SEPARATOR and it contains ":". Xuan can you look at this ASAP or reassign if you can't. We don't need to check ":" in this case. I will make the fix. I've checked in the fix to cvs. Thanks Xuan. reopen it to check in fix. Committed the fix into cvs. Radoslav, Could you please verify if the fix is good for your scenario? Thanks. The fix is working however I've found another problems (bug #218947) with getRemoteFileObject, so I'm going to override it with my own implementation as Martin suggested. Close it. |
I am implementing a file subsystem for WinCE and I am having problems with creating file filters other than "/" (which lists roots). On WinCE the root directory is "\" and there are no volumes. The path separator is \, so we have the following directory structure: \ \Temp \My Documents \Windows \Windows\System ... When I try to resolve some file filter, e.g. "\My Documents\*", FileServiceSubSystem#getRemoteFileObject returns null and the filter cannot be resolved. Consider the following code: public IRemoteFile getRemoteFileObject(...) { String fofName = folderOrFileName; if (folderOrFileName.length() > 1) { fofName = ArchiveHandlerManager.cleanUpVirtualPath(folderOrFileName); } ... } public static String cleanUpVirtualPath(String fullVirtualName) { int j = fullVirtualName.indexOf(VIRTUAL_CANONICAL_SEPARATOR); if (j == -1 && fullVirtualName.indexOf(":") != -1) return fullVirtualName; ... } cleanUpVirtualPath is supposed to return the same string if the specified path is not virtual. The test for not being virtual is to contain both VIRTUAL_CANONICAL_SEPARATOR and ":". This test is satisfied for "C:\My Documents\" but fails for "\My Documents\". So the latter is considered virtual path and all separators are changed to / which is not correct. Looking only for VIRTUAL_CANONICAL_SEPARATOR seems to fix the problem but I don't know what are the other implications of this change because I am not very familiar with virtual paths.