Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-beck committed Mar 8, 2024
1 parent 2297112 commit 29d26a0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,20 @@ protected Set<ArtifactCoordinates> listAllJenkinsWars(String groupId) throws IOE
}

private static boolean containsIllegalChars(String test) {
return !test.chars().allMatch(c -> c >= 0x2B && c < 0x7B);
return !test.chars().allMatch(c ->
c >= '0' && c <= '9'
|| c >= 'A' && c <= 'Z'
|| c >= 'a' && c <= 'z'
|| c == '+' || c == '-' || c == '.' || c == '/' || c == '_'
);
}

private static ArtifactCoordinates toGav(JsonFile f) {
String fileName = f.name;
String path = f.path;

if (containsIllegalChars(fileName) || containsIllegalChars(path)) {
LOGGER.log(Level.INFO, "Not only printable ascii: " + f.path + " / " + f.name);
LOGGER.log(Level.INFO, "Characters outside allowed set: " + f.path + " / " + f.name);
return null;
}

Expand Down

0 comments on commit 29d26a0

Please sign in to comment.