void () { File targetFile = tempDir.newFile("target.txt"); File linkFile = createSymLink(targetFile.getPath(), tempDir.getRoot() + "/link"); VirtualFile linkVFile = refreshAndFind(linkFile); assertTrue("link=" + linkFile + ", vLink=" + linkVFile, linkVFile != null && !linkVFile.isDirectory() && linkVFile.is(VFileProperty.SYMLINK)); setWritableAndCheck(targetFile, true); refresh(tempDir.getRoot()); assertTrue(linkVFile.getPath(), linkVFile.isWritable()); setWritableAndCheck(targetFile, false); refresh(tempDir.getRoot()); assertFalse(linkVFile.getPath(), linkVFile.isWritable()); File targetDir = tempDir.newDirectory("target"); File linkDir = createSymLink(targetDir.getPath(), tempDir.getRoot() + "/linkDir"); VirtualFile linkVDir = refreshAndFind(linkDir); assertTrue("link=" + linkDir + ", vLink=" + linkVDir, linkVDir != null && linkVDir.isDirectory() && linkVDir.is(VFileProperty.SYMLINK)); if (!SystemInfo.isWindows) { setWritableAndCheck(targetDir, true); refresh(tempDir.getRoot()); assertTrue(linkVDir.getPath(), linkVDir.isWritable()); setWritableAndCheck(targetDir, false); refresh(tempDir.getRoot()); assertTrue(linkVDir.getPath(), linkVDir.isWritable()); } else { assertEquals(linkVDir.getPath(), targetDir.canWrite(), linkVDir.isWritable()); } }