Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.6
-
None
-
None
Description
When using FilenameUtils#getFullPathNoEndSeparator with directories, windows and linux are returning different results.
Linux returns ".../subfolder" and windows returns "...\path".
private static void commonsIo() { String result = getSubFolderFromFile(new File("C:\\path\\subfolder\\")); // Fails in common-io:2.11.0 b/c result is "path" instead of "subfolder". System.out.println("result should be \"subfolder\", but it is: " + result); } private static String getSubFolderFromFile(final File file) { return FilenameUtils.getBaseName(FilenameUtils.getFullPathNoEndSeparator(file.getAbsolutePath())); }
The result should be equal when using both OS.