aQute.bnd.osgi.ManifestResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biz.aQute.bnd Show documentation
Show all versions of biz.aQute.bnd Show documentation
This command line utility is the Swiss army knife of OSGi. It provides you with a breadth of tools to understand and manage OSGi based systems. This project basically uses bndlib.
package aQute.bnd.osgi;
import static java.util.Objects.requireNonNull;
import java.io.IOException;
import java.io.OutputStream;
import java.util.jar.Manifest;
import aQute.lib.manifest.ManifestUtil;
/**
* Bnd Resource for Manifest with correct support for writing the manifest to an
* output stream.
*/
public class ManifestResource extends WriteResource {
private final Manifest manifest;
public ManifestResource(Manifest manifest) {
this.manifest = requireNonNull(manifest);
}
public ManifestResource() {
this(new Manifest());
}
public Manifest getManifest() {
return manifest;
}
@Override
public long lastModified() {
return 0L;
}
@Override
public void write(OutputStream out) throws IOException {
ManifestUtil.write(manifest, out);
}
}