use of org.springframework.boot.loader.archive.Archive.EntryFilter in project spring-boot by spring-projects.
the class PropertiesLauncher method getNestedArchives.
private List<Archive> getNestedArchives(String root) throws Exception {
if (root.startsWith("/") || this.parent.getUrl().equals(this.home.toURI().toURL())) {
// If home dir is same as parent archive, no need to add it twice.
return null;
}
Archive parent = this.parent;
if (root.startsWith("jar:file:") && root.contains("!")) {
int index = root.indexOf("!");
String file = root.substring("jar:file:".length(), index);
parent = new JarFileArchive(new File(file));
root = root.substring(index + 1, root.length());
while (root.startsWith("/")) {
root = root.substring(1);
}
}
EntryFilter filter = new PrefixMatchingArchiveFilter(root);
return parent.getNestedArchives(filter);
}
Aggregations