mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
Resolve only symlinks and junctions on Windows
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -108,7 +108,8 @@ JNIEXPORT jstring JNICALL Java_com_intellij_openapi_util_io_win32_IdeaWin32_reso
|
||||
if (h != INVALID_HANDLE_VALUE) {
|
||||
FindClose(h);
|
||||
|
||||
if (IS_SET(data.dwFileAttributes, FILE_ATTRIBUTE_REPARSE_POINT)) {
|
||||
if (IS_SET(data.dwFileAttributes, FILE_ATTRIBUTE_REPARSE_POINT) &&
|
||||
(IS_SET(data.dwReserved0, IO_REPARSE_TAG_SYMLINK) || IS_SET(data.dwReserved0, IO_REPARSE_TAG_MOUNT_POINT))) {
|
||||
HANDLE th = CreateFileW(winPath, 0, FILE_SHARE_ATTRIBUTES, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||
if (th != INVALID_HANDLE_VALUE) {
|
||||
wchar_t buff[MAX_PATH], * finalPath = buff;
|
||||
|
||||
@@ -307,6 +307,13 @@ public class FileAttributesReadingTest {
|
||||
final FileAttributes attributes = getAttributes(substRoot);
|
||||
assertEquals(FileAttributes.Type.DIRECTORY, attributes.type);
|
||||
assertDirectoriesEqual(substRoot);
|
||||
|
||||
final File[] children = substRoot.listFiles();
|
||||
assertNotNull(children);
|
||||
assertEquals(1, children.length);
|
||||
final File file = children[0];
|
||||
final String target = FileSystemUtil.resolveSymLink(file);
|
||||
assertEquals(file.getPath(), target);
|
||||
}
|
||||
finally {
|
||||
IoTestUtil.deleteSubst(substRoot.getPath());
|
||||
|
||||
@@ -115,7 +115,7 @@ public class IoTestUtil {
|
||||
final int res = runCommand(command);
|
||||
assertEquals(command.command().toString(), 0, res);
|
||||
|
||||
final File rootFile = new File(substRoot);
|
||||
final File rootFile = new File(substRoot + "\\");
|
||||
assertTrue("target=" + target + ", subst=" + rootFile, rootFile.isDirectory());
|
||||
return rootFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user