All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aQute.bnd.osgi.ManifestResource Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 7.1.0
Show newest version
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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy