|
|
|
@ -25,6 +25,7 @@ import java.util.Map;
|
|
|
|
|
import java.util.jar.JarFile;
|
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
|
|
|
|
|
|
import org.yaml.snakeyaml.LoaderOptions;
|
|
|
|
|
import org.yaml.snakeyaml.Yaml;
|
|
|
|
|
import org.yaml.snakeyaml.constructor.Constructor;
|
|
|
|
|
|
|
|
|
@ -45,7 +46,11 @@ class LayersIndex extends ArrayList<Map<String, List<String>>> {
|
|
|
|
|
String indexPath = (archiveFile.getName().endsWith(".war") ? "WEB-INF/layers.idx" : "BOOT-INF/layers.idx");
|
|
|
|
|
try (JarFile jarFile = new JarFile(archiveFile)) {
|
|
|
|
|
ZipEntry indexEntry = jarFile.getEntry(indexPath);
|
|
|
|
|
Yaml yaml = new Yaml(new Constructor(LayersIndex.class));
|
|
|
|
|
LoaderOptions loaderOptions = new LoaderOptions();
|
|
|
|
|
loaderOptions.setAllowDuplicateKeys(false);
|
|
|
|
|
loaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE);
|
|
|
|
|
loaderOptions.setAllowRecursiveKeys(true);
|
|
|
|
|
Yaml yaml = new Yaml(new Constructor(LayersIndex.class, loaderOptions));
|
|
|
|
|
return yaml.load(jarFile.getInputStream(indexEntry));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|