Community
Participate
Working Groups
The zip file I used to recreate this problem had one folder called 6YLT5X, and inside this folder, I had four subfolders. One of the subfolder is named 20070305a. And inside the subfolder, there is a file called QB5ROUTE I expanded 6YLT5X, expand subfolder 20070305a, then rename file QB5ROUTE to QB5ROUTEa. The renamed file name shown in the System view is 20070305a\QB5ROUTEa. -----------Enter bugs above this line----------- TM 2.0M7 Testing installation : eclipse-platform-3.3M7 (I20070503-1400) RSE install : Dev driver java.runtime : Sun 1.5.0_06-b05 os.name: : Windows XP 5.1, Service Pack 2 ------------------------------------------------ systemtype : Windows - DStore ------------------------------------------------
It seems the logic in DStoreHostFile#renameTo() could not determine the name of a file inside a zip file correctly.
I compared two renameTo() methods: VirtualChild#renameTo(String newName) -- called by the renaming of a virtual file by local connection DStoreHostFile#renameTo(String newAbsolutePath) -- called by the renaming of a virtual file by DStore connection. VirtualChild#renameTo(String newName) { newName = ArchiveHandlerManager.cleanUpVirtualPath(newName); fullName = newName; int i = newName.lastIndexOf("/"); //$NON-NLS-1$ if (i == -1) { name = newName; path = ""; //$NON-NLS-1$ } else { name = newName.substring(i+1); path = newName.substring(0, i); } // force reextraction of temp file _extractedFile = null; } DStoreHostFile#renameTo(String newAbsolutePath) { String current = getName(); int lastSep = newAbsolutePath.lastIndexOf('/'); if (lastSep == -1) lastSep = newAbsolutePath.lastIndexOf('\\'); String newName = newAbsolutePath.substring(lastSep + 1); if (newName.equals(current)) { // data element already updated } else { _element.setAttribute(DE.A_NAME, newName); } _isArchive = internalIsArchive(); } In my case, the full path of the virtual file name is: D:\\tmp\\mynewzip.zip#virtual#/6YLT5Xa/20070315\\QB5ROUTaa As we can see, in VirtualChild#renameTo(String newName), ArchiveHandlerManager.cleanUpVirtualPath(newName) is called first to covert all the backslash to slash, but DStoreHostFile#renameTo(String newAbsolutePath) does not. So it gets the name as "20070315\\QB5ROUTaa", instead of "QB5ROUTaa". We need to change the implementation of DStoreHostFile#renameTo() to be similar to VirtualChild#renameTo().
Can we apply Xuan's idea?
Yes, we should use that cleanupvirtualpath method.
I will test it and provide the patch. Thanks.
Created attachment 68889 [details] Fix - need to call ArchiveHandlerManager.cleanUpVirtualPath in DStoreHostFile#renameTo() Legal Message: I, Xuan Chen, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this contribution under the EPL.
There is some problem in the previous provided patch. I should not remove the code for finding index of '\\'. Unlike VirtualChild#renameTo(String newName) which is only for archive files, DStoreHostFile#renameTo() applies for other files as well. I will provide an update version of patch. Thanks.
Created attachment 68927 [details] Updated fix - should not remove checking for '\\'. Legal Message: I, Xuan Chen, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this contribution under the EPL.
I've applied and committed the patch.
fixed in 2.0 RC4 driver.
[target cleanup] 2.0 RC2 was the original target milestone for this bug