Skip to content

Commit

Permalink
DefaultArchiveExtractorTest shouldn't fail when symlinks cannot be cr…
Browse files Browse the repository at this point in the history
…eated

Files.createSymbolicLink can also fail with an IOException when the user doesn't have the rights to create a symlink. For example on Windows 10 as normal user withouth admin rights.
  • Loading branch information
arminha committed Dec 6, 2019
1 parent 605672b commit dea2086
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -57,10 +57,10 @@ public void extractBadTarFileSymlink() throws Exception {
extractor.extract(BAD_TAR, link.toString());
}

private Path createSymlinkOrSkipTest(Path link, Path target) throws IOException {
private Path createSymlinkOrSkipTest(Path link, Path target) {
try {
return Files.createSymbolicLink(link, target);
} catch (UnsupportedOperationException e) {
} catch (UnsupportedOperationException | IOException e) {
assumeTrue("symlinks not supported", false);
return null;
}
Expand Down

0 comments on commit dea2086

Please sign in to comment.