File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 33import static io .quarkus .deployment .annotations .ExecutionTime .RUNTIME_INIT ;
44
55import java .nio .file .Files ;
6+ import java .nio .file .Path ;
67import java .util .ArrayList ;
78import java .util .HashSet ;
89import java .util .List ;
@@ -107,11 +108,17 @@ public void nativeImageResource(Optional<StaticResourcesBuildItem> staticResourc
107108 */
108109 private Set <StaticResourcesBuildItem .Entry > getClasspathResources () {
109110 Set <StaticResourcesBuildItem .Entry > knownPaths = new HashSet <>();
111+ final String prefix = StaticResourcesRecorder .META_INF_RESOURCES ;
110112 visitRuntimeMetaInfResources (visit -> {
111- if (!Files .isDirectory (visit .getPath ())) {
112- knownPaths .add (new StaticResourcesBuildItem .Entry (
113- visit .getRelativePath ().substring (StaticResourcesRecorder .META_INF_RESOURCES .length ()),
114- false ));
113+ Path visitPath = visit .getPath ();
114+ if (!Files .isDirectory (visitPath )) {
115+ String rel = visit .getRelativePath ();
116+ // Ensure that the relative path starts with the prefix before calling substring
117+ if (rel .startsWith (prefix )) {
118+ // Strip the "META-INF/resources/" prefix and add the remainder
119+ String subPath = rel .substring (prefix .length ());
120+ knownPaths .add (new StaticResourcesBuildItem .Entry (subPath , false ));
121+ }
115122 }
116123 });
117124 return knownPaths ;
You can’t perform that action at this time.
0 commit comments