Skip to content

Commit

Permalink
Apply patch from GR-32195 (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: jose.pereda <jose.pereda@gluonhq.com>
  • Loading branch information
José Pereda and jperedadnr authored Jun 21, 2021
1 parent cb7fdfa commit 77a270a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -252,13 +253,16 @@ private static void scanDirectory(DebugContext debugContext, File root, Pattern[
Map<String, List<String>> matchedDirectoryResources = new HashMap<>();
Set<String> allEntries = new HashSet<>();
ArrayList<File> queue = new ArrayList<>();
String separator = FileSystems.getDefault().getSeparator();

queue.add(root);
while (!queue.isEmpty()) {
File file = queue.remove(0);
String relativeFilePath = "";
if (file != root) {
relativeFilePath = file.getAbsolutePath().substring(root.getAbsolutePath().length() + 1);
/* Java resources always use / as the path separator, as do our resource inclusion patterns. */
relativeFilePath = relativeFilePath.replace(separator, "/");
}
if (file.isDirectory()) {
if (!relativeFilePath.isEmpty()) {
Expand Down

0 comments on commit 77a270a

Please sign in to comment.