diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/SymlinkTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/SymlinkTest.java index c3f8aefa0a0..5ed949138e7 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/SymlinkTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/filesystem/SymlinkTest.java @@ -96,15 +96,15 @@ protected void makeLinkStructure() throws CoreException, IOException { llFile = baseStore.getChild("llFile"); ensureExists(aDir, true); ensureExists(aFile, false); - mkLink(baseStore, "lDir", "aDir", true); - mkLink(baseStore, "llDir", "lDir", true); - mkLink(baseStore, "lFile", "aFile", false); - mkLink(baseStore, "llFile", "lFile", false); + mkLink(baseStore, "lDir", "aDir"); + mkLink(baseStore, "llDir", "lDir"); + mkLink(baseStore, "lFile", "aFile"); + mkLink(baseStore, "llFile", "lFile"); fetchFileInfos(); } - protected void mkLink(IFileStore dir, String src, String tgt, boolean isDir) throws IOException, CoreException { - FileSystemHelper.createSymLink(dir.toLocalFile(EFS.NONE, getMonitor()), src, tgt, isDir); + protected void mkLink(IFileStore dir, String src, String tgt) throws IOException, CoreException { + FileSystemHelper.createSymLink(dir.toLocalFile(EFS.NONE, getMonitor()), src, tgt); } @Test @@ -209,8 +209,8 @@ public void testBrokenSymlinkRemove() throws Exception { @Test public void testRecursiveSymlink() throws Exception { IFileStore baseStore = fileStoreExtension.getFileStore(); - mkLink(baseStore, "l1", "l2", false); - mkLink(baseStore, "l2", "l1", false); + mkLink(baseStore, "l1", "l2"); + mkLink(baseStore, "l2", "l1"); IFileStore l1 = baseStore.getChild("l1"); IFileInfo i1 = l1.fetchInfo(); assertEquals(SYMLINKS_ARE_FIRST_CLASS_FILES_OR_DIRECTORIES, i1.exists()); @@ -343,8 +343,8 @@ public void _testSymlinkExtendedChars() throws Exception { ensureExists(childDir, true); IFileStore childFile = baseStore.getChild("ff" + specialCharName); ensureExists(childFile, false); - mkLink(baseStore, "l" + specialCharName, specialCharName, true); - mkLink(baseStore, "lf" + specialCharName, "ff" + specialCharName, false); + mkLink(baseStore, "l" + specialCharName, specialCharName); + mkLink(baseStore, "lf" + specialCharName, "ff" + specialCharName); IFileInfo[] infos = baseStore.childInfos(EFS.NONE, getMonitor()); assertThat(infos).hasSize(4); assertThat(infos).allSatisfy(info -> { diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java index f0bc8cee8f8..f20686f26d0 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/internal/localstore/SymlinkResourceTest.java @@ -48,8 +48,8 @@ @ExtendWith(WorkspaceResetExtension.class) public class SymlinkResourceTest { - private void mkLink(IFileStore dir, String src, String tgt, boolean isDir) throws CoreException, IOException { - createSymLink(dir.toLocalFile(EFS.NONE, createTestMonitor()), src, tgt, isDir); + private void mkLink(IFileStore dir, String src, String tgt) throws CoreException, IOException { + createSymLink(dir.toLocalFile(EFS.NONE, createTestMonitor()), src, tgt); } protected void createBug232426Structure(IFileStore rootDir) throws CoreException, IOException { @@ -61,10 +61,10 @@ protected void createBug232426Structure(IFileStore rootDir) throws CoreException folderC.mkdir(EFS.NONE, createTestMonitor()); /* create symbolic links */ - mkLink(folderA, "link", IPath.fromOSString("../b").toOSString(), true); - mkLink(folderB, "linkA", IPath.fromOSString("../a").toOSString(), true); - mkLink(folderB, "linkC", IPath.fromOSString("../c").toOSString(), true); - mkLink(folderC, "link", IPath.fromOSString("../b").toOSString(), true); + mkLink(folderA, "link", IPath.fromOSString("../b").toOSString()); + mkLink(folderB, "linkA", IPath.fromOSString("../a").toOSString()); + mkLink(folderB, "linkC", IPath.fromOSString("../c").toOSString()); + mkLink(folderC, "link", IPath.fromOSString("../b").toOSString()); } protected void createBug358830Structure(IFileStore rootDir) throws CoreException, IOException { @@ -72,7 +72,7 @@ protected void createBug358830Structure(IFileStore rootDir) throws CoreException folderA.mkdir(EFS.NONE, createTestMonitor()); /* create trivial recursive symbolic link */ - mkLink(folderA, "link", IPath.fromOSString("../").toOSString(), true); + mkLink(folderA, "link", IPath.fromOSString("../").toOSString()); } /** diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceTest.java index ac173b9006e..2188c37a8a8 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/LinkedResourceTest.java @@ -1773,7 +1773,7 @@ public void testLinkedFolderWithSymlink_Bug338010() throws Exception { fileStoreExtension.deleteOnTearDown(resolvedBaseLocation); IPath symlinkTarget = resolvedBaseLocation.append("dir1/target"); symlinkTarget.toFile().mkdirs(); - createSymLink(resolvedBaseLocation.toFile(), "symlink", symlinkTarget.toOSString(), true); + createSymLink(resolvedBaseLocation.toFile(), "symlink", symlinkTarget.toOSString()); IPath linkChildLocation = baseLocation.append("symlink/dir2"); IPath resolvedLinkChildLocation = resolve(linkChildLocation); File linkChild = resolvedLinkChildLocation.toFile(); @@ -1800,7 +1800,7 @@ public void testDeleteLinkTarget_Bug507084() throws Exception { symlinkTarget.append("B/C").toFile().mkdirs(); IPath linkParentDir = resolvedBaseLocation.append("dir2"); linkParentDir.toFile().mkdirs(); - createSymLink(linkParentDir.toFile(), "symlink", symlinkTarget.toOSString(), true); + createSymLink(linkParentDir.toFile(), "symlink", symlinkTarget.toOSString()); IFolder folder = nonExistingFolderInExistingProject; IPath symLink = linkParentDir.append("symlink"); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceAttributeTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceAttributeTest.java index 495e6f12c06..ddff388d78f 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceAttributeTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/ResourceAttributeTest.java @@ -268,7 +268,7 @@ public void testAttributeSymlink() throws Exception { // create a link to the target file and add it to the workspace, // the resource in the workspace should have symbolic link attribute set - createSymLink(project.getLocation().toFile(), "link", "target", false); + createSymLink(project.getLocation().toFile(), "link", "target"); createInWorkspace(link); assertTrue(link.getResourceAttributes().isSymbolicLink()); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/WorkspaceTest.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/WorkspaceTest.java index f7c08e2e868..d2fae372566 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/WorkspaceTest.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/WorkspaceTest.java @@ -355,7 +355,7 @@ public void testWorkingLocationDeletion_bug433061() throws Throwable { assertTrue(file.exists()); // Create a symlink in the working location of the project pointing to // linkTarget. - createSymLink(workingLocation.toFile(), "link", linkTarget.toOSString(), true); + createSymLink(workingLocation.toFile(), "link", linkTarget.toOSString()); monitor.prepare(); project.delete(true, monitor); monitor.assertUsedUp(); diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_185247_recursiveLinks.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_185247_recursiveLinks.java index 739a293c0c0..653d398e601 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_185247_recursiveLinks.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_185247_recursiveLinks.java @@ -282,8 +282,7 @@ private static void createDirectory(File directory) { void createSymlink(File directory, String linkName, String linkTarget) throws IOException { assertTrue(canCreateSymLinks(), "symlinks not supported by platform"); - boolean isDir = true; - createSymLink(directory, linkName, linkTarget, isDir); + createSymLink(directory, linkName, linkTarget); } private IProject importProjectAndRefresh(String projectName, URI projectRootLocation) throws Exception { diff --git a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_233939.java b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_233939.java index 923d9acf1c6..de4360f433a 100644 --- a/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_233939.java +++ b/resources/tests/org.eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/Bug_233939.java @@ -59,7 +59,7 @@ public void requireCanCreateSymlinks() throws IOException { */ protected void symLinkAndRefresh(IContainer container, String linkName, IPath linkTarget) throws CoreException, IOException { - createSymLink(container.getLocation().toFile(), linkName, linkTarget.toOSString(), false); + createSymLink(container.getLocation().toFile(), linkName, linkTarget.toOSString()); container.refreshLocal(IResource.DEPTH_INFINITE, createTestMonitor()); IResource theLink = container.findMember(linkName); assertExistsInWorkspace(theLink); diff --git a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/FileSystemHelper.java b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/FileSystemHelper.java index 9270355313f..0340c36cb51 100644 --- a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/FileSystemHelper.java +++ b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/FileSystemHelper.java @@ -114,7 +114,6 @@ public static void clear(java.io.File file) { * @param basedir folder in which the symbolic link should be created * @param linkName name of the symbolic link * @param linkTarget target to which the symbolic link should point - * @param isDir unused, retained for compatibility * @throws FileSystemException if the link could not be created, e.g. * due to missing privileges on Windows * @throws UnsupportedOperationException if symbolic links are generally not @@ -122,7 +121,7 @@ public static void clear(java.io.File file) { * @throws IOException in case the creation of the symlink * failed for other reasons */ - public static void createSymLink(File basedir, String linkName, String linkTarget, boolean isDir) + public static void createSymLink(File basedir, String linkName, String linkTarget) throws IOException { Files.createSymbolicLink(basedir.toPath().resolve(linkName), Path.of(linkTarget)); } @@ -143,7 +142,7 @@ public static boolean canCreateSymLinks() throws IOException { String linkName = FileSystemHelper.getRandomLocation(tempDir).lastSegment(); try { // Try to create a symlink. - createSymLink(tempDir.toFile(), linkName, "testTarget", false); + createSymLink(tempDir.toFile(), linkName, "testTarget"); // Clean up if the link was created. new File(tempDir.toFile(), linkName).delete(); canCreateSymLinks = Boolean.TRUE;