diff --git a/pom.xml b/pom.xml index 363ef02..721f639 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.jvnet.hudson.plugins analysis-pom - 11.2846.v4a_6b_a_1222295 + 11.2852.v88a_36fe3230d diff --git a/src/main/java/io/jenkins/plugins/fontawesome/FontAwesomeIcons.java b/src/main/java/io/jenkins/plugins/fontawesome/FontAwesomeIcons.java index 34b5d62..ea6c9ed 100644 --- a/src/main/java/io/jenkins/plugins/fontawesome/FontAwesomeIcons.java +++ b/src/main/java/io/jenkins/plugins/fontawesome/FontAwesomeIcons.java @@ -1,5 +1,9 @@ package io.jenkins.plugins.fontawesome; +import org.apache.commons.lang3.Strings; + +import edu.umd.cs.findbugs.annotations.CheckForNull; + import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -17,10 +21,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.commons.lang3.StringUtils; - -import edu.umd.cs.findbugs.annotations.CheckForNull; - import io.jenkins.plugins.fontawesome.SvgTag.FontAwesomeStyle; /** @@ -75,10 +75,10 @@ private static Map getIconsFromClasspath(@CheckForNull final Fon while (urls.hasMoreElements()) { URL url = urls.nextElement(); - if (StringUtils.contains(url.toExternalForm(), FONT_AWESOME_API_PLUGIN)) { + if (Strings.CS.contains(url.toExternalForm(), FONT_AWESOME_API_PLUGIN)) { URI uri = url.toURI(); - if (StringUtils.equals(uri.getScheme(), "jar")) { + if (Strings.CS.contains(uri.getScheme(), "jar")) { try (FileSystem fileSystem = FileSystems.newFileSystem(uri, Collections.emptyMap())) { return filterIcons(fileSystem.getPath(IMAGES_SYMBOLS_PATH), filter); } @@ -114,11 +114,11 @@ private static Stream createIconStream(final Path iconFolder, @CheckForNul private static String createFileName(final Path icon) { return icon.getParent().getFileName() + "/" - + StringUtils.removeEnd(icon.getFileName().toString(), SVG_FILE_ENDING); + + Strings.CS.removeEnd(icon.getFileName().toString(), SVG_FILE_ENDING); } private static boolean isSvgImage(final Path path) { - return StringUtils.endsWith(path.getFileName().toString(), SVG_FILE_ENDING); + return Strings.CS.endsWith(path.getFileName().toString(), SVG_FILE_ENDING); } private FontAwesomeIcons() { diff --git a/src/test/java/io/jenkins/plugins/fontawesome/FontAwesomeIconsTest.java b/src/test/java/io/jenkins/plugins/fontawesome/FontAwesomeIconsTest.java index 552bac8..99084b9 100644 --- a/src/test/java/io/jenkins/plugins/fontawesome/FontAwesomeIconsTest.java +++ b/src/test/java/io/jenkins/plugins/fontawesome/FontAwesomeIconsTest.java @@ -1,5 +1,14 @@ package io.jenkins.plugins.fontawesome; +import org.apache.commons.lang3.Strings; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; +import org.junit.jupiter.params.provider.NullSource; + +import edu.umd.cs.findbugs.annotations.CheckForNull; + import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -10,15 +19,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.commons.lang3.StringUtils; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.NullSource; - -import edu.umd.cs.findbugs.annotations.CheckForNull; - import static org.assertj.core.api.Assertions.*; /** @@ -51,8 +51,8 @@ void testGetAvailableIconsFiltered(@CheckForNull final SvgTag.FontAwesomeStyle s try (Stream stream = Files .walk(Paths.get("./target/classes/images/symbols/" + (style == null ? "" : style.name().toLowerCase(Locale.ENGLISH))), 2)) { Set iconNames = stream - .filter(path -> StringUtils.endsWith(path.getFileName().toString(), ".svg")) - .map(path -> path.getParent().getFileName().toString() + "/" + StringUtils.removeEnd(path.getFileName().toString(), ".svg")) + .filter(path -> Strings.CS.endsWith(path.getFileName().toString(), ".svg")) + .map(path -> path.getParent().getFileName().toString() + "/" + Strings.CS.removeEnd(path.getFileName().toString(), ".svg")) .collect(Collectors.toSet()); assertThat(availableIcons.keySet()).isEqualTo(iconNames);