Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
-
any filesystem that's case insensitive but case preserving (windows, osx)
Description
When you try to change the case of a file via FileObject.moveTo(), VFS first deletes the target
file, which in a case-insentive FS is the same as the original and is left with nothing no files
anymore..
For example:
StandardFileSystemManager fileSystemManager
= new StandardFileSystemManager();
fileSystemManager.setCacheStrategy(CacheStrategy.ON_RESOLVE);
fileSystemManager.init();
FileSystemOptions fileoptions = new FileSystemOptions();
FileObject root = fileSystemManager.resolveFile("/tmp/", fileoptions);
File dummy = new File("/tmp/test.txt");
dummy.createNewFile();
Writer w = new FileWriter(dummy);
w.write("Some text");
w.close();
long size = dummy.length();
FileObject fo = root.resolveFile("test.txt");
FileObject fo2 = root.resolveFile("TeST.txt");
fo.moveTo(fo2);
At the end of the test, neither test.txt nor TeST.txt exists...
Cheers,
- Filip