File name with backslashes (low-level)

This commit is contained in:
Roman Shevchenko
2012-08-07 17:28:09 +04:00
parent 3525af552e
commit a95c5e624c
2 changed files with 7 additions and 1 deletions
@@ -133,7 +133,7 @@ public class FileSystemUtil {
@SuppressWarnings("UnusedDeclaration")
@Nullable
public static FileAttributes getAttributes(@NotNull final File file) {
return getAttributes(file.getAbsolutePath());
return getAttributes(file.getPath());
}
public static boolean isSymLink(@NotNull final String path) {
@@ -108,6 +108,12 @@ public class FileAttributesReadingTest {
assertFileAttributes(new File(file.getPath().replace(File.separator, File.separator + "." + File.separator)));
assertFileAttributes(new File(myTempDirectory,
File.separator + ".." + File.separator + myTempDirectory.getName() + File.separator + file.getName()));
if (SystemInfo.isUnix) {
final File backSlashFile = FileUtil.createTempFile(myTempDirectory, "test\\", "\\txt", true);
FileUtil.writeToFile(backSlashFile, myTestData);
assertFileAttributes(backSlashFile);
}
}
@Test