[platform] recognizes "mount point" type reparse tags as symlinks, part 2 (IDEA-162327)

This commit is contained in:
Roman Shevchenko
2017-01-04 19:19:41 +01:00
parent 4325f4055e
commit be7d007050
4 changed files with 5 additions and 4 deletions
Binary file not shown.
Binary file not shown.
@@ -262,7 +262,8 @@ public class FileSystemUtil {
Object pathObj = myGetPath.invoke(null, path, ArrayUtil.EMPTY_STRING_ARRAY);
Object attributes = myReadAttributes.invoke(null, pathObj, mySchema, myNoFollowLinkOptions);
boolean isSymbolicLink = (Boolean)myIsSymbolicLink.invoke(attributes);
boolean isSymbolicLink = (Boolean)myIsSymbolicLink.invoke(attributes) ||
SystemInfo.isWindows && (Boolean)myIsOther.invoke(attributes) && (Boolean)myIsDirectory.invoke(attributes);
if (isSymbolicLink) {
try {
attributes = myReadAttributes.invoke(null, pathObj, mySchema, myLinkOptions);
@@ -303,7 +303,7 @@ public abstract class FileAttributesReadingTest {
try {
FileAttributes attributes = getAttributes(junction);
assertEquals(FileAttributes.Type.DIRECTORY, attributes.type);
assertEquals(0, attributes.flags);
assertEquals(FileAttributes.SYM_LINK, attributes.flags);
assertTrue(attributes.isWritable());
final String resolved1 = FileSystemUtil.resolveSymLink(junction);
@@ -312,8 +312,8 @@ public abstract class FileAttributesReadingTest {
FileUtil.delete(target);
attributes = getAttributes(junction);
assertEquals(FileAttributes.Type.DIRECTORY, attributes.type);
assertEquals(0, attributes.flags);
assertNull(attributes.type);
assertEquals(FileAttributes.SYM_LINK, attributes.flags);
assertTrue(attributes.isWritable());
final String resolved2 = FileSystemUtil.resolveSymLink(junction);