static String fileNameOfClass(final String className, String typeSuffix) {
return className.replace('.', '/') + "." + typeSuffix;
}
public PackageSpec getPackageSpec(String name) throws IOException {
final PackageSpec spec = new PackageSpec();
final Manifest manifest = this.manifest;
if (manifest == null) {
return spec;
}
final Attributes mainAttribute = manifest.getAttributes(name);
final Attributes entryAttribute = manifest.getAttributes(name);
spec.setSpecTitle(getDefinedAttribute(Attributes.Name.SPECIFICATION_TITLE, entryAttribute, mainAttribute));
spec.setSpecVersion(getDefinedAttribute(Attributes.Name.SPECIFICATION_VERSION, entryAttribute, mainAttribute));
spec.setSpecVendor(getDefinedAttribute(Attributes.Name.SPECIFICATION_VENDOR, entryAttribute, mainAttribute));
spec.setImplTitle(getDefinedAttribute(Attributes.Name.IMPLEMENTATION_TITLE, entryAttribute, mainAttribute));
spec.setImplVersion(getDefinedAttribute(Attributes.Name.IMPLEMENTATION_VERSION, entryAttribute, mainAttribute));
spec.setImplVendor(getDefinedAttribute(Attributes.Name.IMPLEMENTATION_VENDOR, entryAttribute, mainAttribute));
if (Boolean.parseBoolean(getDefinedAttribute(Attributes.Name.SEALED, entryAttribute, mainAttribute))) {
spec.setSealBase(classesRoot.toURI().toURL());
}
return spec;
}