From 29d26a06cbb6445ad2b1897c9d495724c7fb83ed Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Fri, 8 Mar 2024 12:15:58 +0100 Subject: [PATCH] PR #686 --- .../jenkins/update_center/ArtifactoryRepositoryImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/jenkins/update_center/ArtifactoryRepositoryImpl.java b/src/main/java/io/jenkins/update_center/ArtifactoryRepositoryImpl.java index 60e3f1cab..e8bf057ab 100644 --- a/src/main/java/io/jenkins/update_center/ArtifactoryRepositoryImpl.java +++ b/src/main/java/io/jenkins/update_center/ArtifactoryRepositoryImpl.java @@ -79,7 +79,12 @@ protected Set 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) { @@ -87,7 +92,7 @@ private static ArtifactCoordinates toGav(JsonFile f) { 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; }