Search in sources :

Example 36 with Domain

use of aQute.bnd.osgi.Domain in project bnd by bndtools.

the class ResourceBuilder method addFile.

public boolean addFile(File file, URI uri) throws Exception {
    if (uri == null)
        uri = file.toURI();
    Domain manifest = Domain.domain(file);
    String mime = BUNDLE_MIME_TYPE;
    boolean hasIdentity = false;
    if (manifest != null)
        hasIdentity = addManifest(manifest);
    else
        mime = JAR_MIME_TYPE;
    String sha256 = SHA256.digest(file).asHex();
    addContentCapability(uri, sha256, file.length(), mime);
    return hasIdentity;
}
Also used : Domain(aQute.bnd.osgi.Domain)

Aggregations

Domain (aQute.bnd.osgi.Domain)36 Parameters (aQute.bnd.header.Parameters)24 Jar (aQute.bnd.osgi.Jar)24 Attrs (aQute.bnd.header.Attrs)18 File (java.io.File)18 Builder (aQute.bnd.osgi.Builder)16 Manifest (java.util.jar.Manifest)15 ArrayList (java.util.ArrayList)8 Resource (aQute.bnd.osgi.Resource)6 ResourceBuilder (aQute.bnd.osgi.resource.ResourceBuilder)5 FileResource (aQute.bnd.osgi.FileResource)4 Container (aQute.bnd.build.Container)3 PomFromManifest (aQute.bnd.maven.PomFromManifest)3 Analyzer (aQute.bnd.osgi.Analyzer)3 Version (aQute.bnd.version.Version)3 List (java.util.List)3 DistroOptions (aQute.bnd.main.RemoteCommand.DistroOptions)2 RemoteOptions (aQute.bnd.main.RemoteCommand.RemoteOptions)2 PackageRef (aQute.bnd.osgi.Descriptors.PackageRef)2 EmbeddedResource (aQute.bnd.osgi.EmbeddedResource)2