map.put(key.toString(), commonProps.getProperty(key.toString()));
A2Origin origin = new A2Origin();
Path bundleDir = processBundleJar(file, targetCategoryBase, map, origin);
- if (bundleDir == null)
+ if (bundleDir == null) {
+ logger.log(WARNING, "No bundle dir created for " + file + ", skipping...");
return FileVisitResult.CONTINUE;
+ }
origins.put(bundleDir, origin);
logger.log(DEBUG, () -> "Processed " + file);
}
Manifest sourceManifest;
try (JarInputStream jarIn = new JarInputStream(Files.newInputStream(file), false)) {
sourceManifest = jarIn.getManifest();
+ if (sourceManifest == null)
+ logger.log(WARNING, file + " has no manifest");
manifest = sourceManifest != null ? new Manifest(sourceManifest) : new Manifest();
String rawSourceSymbolicName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME.toString());
nameVersion = new NameVersion(ourSymbolicName, ourVersion);
} else {
nameVersion = nameVersionFromManifest(manifest);
- if (nameVersion == null) {
- logger.log(WARNING, file + " has no symbolic name, skipping...");
- return null;
- }
+ if (nameVersion == null)
+ throw new IllegalStateException("Could not compute name/version from Manifest");
if (ourVersion != null && !nameVersion.getVersion().equals(ourVersion)) {
logger.log(WARNING,
"Original version is " + nameVersion.getVersion() + " while new version is " + ourVersion);
}
/**
- * Effectively download. Synchronised in order to avoid downloading twice in
- * parallel.
+ * Effectively download an archive.
*/
- synchronized Path downloadArchive(URL url, Path dir) throws IOException {
+ Path downloadArchive(URL url, Path dir) throws IOException {
return download(url, dir, (String) null);
}
- /** Effectively download. */
- Path download(URL url, Path dir, String name) throws IOException {
+ /**
+ * Effectively download. Synchronised in order to avoid downloading twice in
+ * parallel.
+ */
+ synchronized Path download(URL url, Path dir, String name) throws IOException {
Path dest;
if (name == null) {