Skip to content

Commit

Permalink
devonfw#139: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
MattesMrzik committed Nov 13, 2023
1 parent c970265 commit a360f9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cli/src/main/java/com/devonfw/tools/ide/io/FileAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public interface FileAccess {

/**
* Symbolic links can point to relative or absolute paths. Here the link is converted to be relative. If the target of
* the link is again a link, then that lead is followed, until the target is not a link.
* the link is again a link, then that lead is not followed.
*
* @param link the {@link Path} of the symbolic link.
*/
Expand All @@ -64,7 +64,7 @@ public interface FileAccess {
*
* @param link the {@link Path} of the symbolic link.
* @param followTarget - {@code true} if the target of the link is again a link, then that lead is followed, until the
* target is not a link. - {@code false} if the target of the link is again a link, then that lead is no
* target is not a link. - {@code false} if the target of the link is again a link, then that lead is not
* followed.
*/
void makeSymlinkRelative(Path link, boolean followTarget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,21 @@

public class FileAccessImplTest extends Assertions {

void arrangetestRelativeSymlinks(Path tempDir, FileAccess fileAccess) {

}

@Test
void testSymlink(@TempDir Path tempDir) {

IdeContext context = IdeTestContextMock.get();
FileAccess fileAccess = new FileAccessImpl(context);
// create a new directory
Path dir = tempDir.resolve("dir");
fileAccess.mkdirs(dir);

// create a new file using nio
Path file = tempDir.resolve("file");
try {
Files.write(file, "Hello World!".getBytes());
} catch (IOException e) {
throw new RuntimeException(e);
throw new RuntimeException("When preparing testSymlink writing of " + file + " failed. ", e);
}

// try to create a symlink to the file using Files.createSymbolicLink
Path link = tempDir.resolve("link");
Path linkToLink = tempDir.resolve("linkToLink");

Expand Down Expand Up @@ -197,7 +190,7 @@ void testMakeSymlinkRelative(@TempDir Path tempDir) {
}
}

// redo move, and check later if symlinks still work
// redo move, and check in assert if symlinks still work
fileAccess.move(parent, parent2);

// assert
Expand Down

0 comments on commit a360f9f

Please sign in to comment.