public class BundleMaker
extends java.lang.Object
Constructor and Description |
---|
BundleMaker(org.osgi.framework.launch.Framework f,
ResourceUtils resources) |
BundleMaker(ManagementContext mgmt) |
BundleMaker(ResourceUtils resources)
Constructor for use when not expecting to use with a framework
|
Modifier and Type | Method and Description |
---|---|
java.io.File |
copyAdding(java.io.File f,
java.util.Map<java.util.zip.ZipEntry,? extends java.io.InputStream> entries)
create a copy of the given ZIP as a JAR with the given entries added at the end (removing any duplicates), returning the new temp file
|
java.io.File |
copyAddingAtEnd(java.io.File f,
java.util.Map<java.util.zip.ZipEntry,? extends java.io.InputStream> entries)
create a copy of the given ZIP as a JAR with the given entries added at the end, returning the new temp file
|
java.io.File |
copyAddingManifest(java.io.File f,
java.util.jar.Manifest mf)
create a copy of the given ZIP as a JAR with the given manifest, returning the new temp file
|
java.io.File |
copyAddingManifest(java.io.File f,
java.util.Map<java.lang.String,java.lang.String> attrs)
as
copyAddingManifest(File, Manifest) but taking manifest entries as a map for convenience |
java.io.File |
copyRemoving(java.io.File f,
<any> filter)
create a copy of the given ZIP as a JAR with the given entries removed, returning the new temp file
|
java.io.File |
copyRemoving(java.io.File f,
java.util.Set<java.lang.String> itemsToRemove)
create a copy of the given ZIP as a JAR with the given entries removed, returning the new temp file
|
java.io.File |
createJarFromClasspathDir(java.lang.String path)
creates a ZIP in a temp file from the given classpath folder,
by recursively taking everything in the referenced directories,
treating the given folder as the root,
respecting the MANIFEST.MF if present (ie putting it first so it is a valid JAR)
|
java.io.File |
createTempBundle(java.lang.String nameHint,
java.util.jar.Manifest mf,
java.util.Map<java.util.zip.ZipEntry,java.io.InputStream> files)
Creates a temporary file with the given metadata
|
java.io.File |
createTempBundle(java.lang.String nameHint,
java.util.Map<java.lang.String,java.lang.String> mf,
java.util.Map<java.util.zip.ZipEntry,java.io.InputStream> files) |
java.io.File |
createTempZip(java.lang.String nameHint,
java.util.Map<java.util.zip.ZipEntry,java.io.InputStream> files) |
java.util.jar.Manifest |
getManifest(java.io.File f)
returns the manifest in a JAR file, or null if no manifest contained therein
|
boolean |
hasOsgiManifest(java.io.File f)
true iff given ZIP/JAR file contains a MANIFEST.MF file defining a bundle symbolic name
|
org.osgi.framework.Bundle |
installBundle(java.io.File f,
boolean start)
Deprecated.
since 0.12.0, use
OsgiManager#installUploadedBundle(org.apache.brooklyn.api.typereg.ManagedBundle, InputStream) |
void |
setDefaultClassForLoading(java.lang.Class<?> optionalDefaultClassForLoading)
if set, this will be used to resolve relative classpath fragments;
the
ResourceUtils supplied in the constructor must also be with respect to the given class |
public BundleMaker(@Nonnull ResourceUtils resources)
public BundleMaker(@Nonnull org.osgi.framework.launch.Framework f, @Nonnull ResourceUtils resources)
public BundleMaker(@Nonnull ManagementContext mgmt)
public void setDefaultClassForLoading(java.lang.Class<?> optionalDefaultClassForLoading)
ResourceUtils
supplied in the constructor must also be with respect to the given classpublic java.io.File createJarFromClasspathDir(java.lang.String path)
public boolean hasOsgiManifest(java.io.File f)
public java.util.jar.Manifest getManifest(java.io.File f)
public java.io.File copyAddingManifest(java.io.File f, java.util.Map<java.lang.String,java.lang.String> attrs)
copyAddingManifest(File, Manifest)
but taking manifest entries as a map for conveniencepublic java.io.File copyAddingManifest(java.io.File f, java.util.jar.Manifest mf)
public java.io.File copyAdding(java.io.File f, java.util.Map<java.util.zip.ZipEntry,? extends java.io.InputStream> entries)
public java.io.File copyAddingAtEnd(java.io.File f, java.util.Map<java.util.zip.ZipEntry,? extends java.io.InputStream> entries)
public java.io.File copyRemoving(java.io.File f, java.util.Set<java.lang.String> itemsToRemove)
public java.io.File copyRemoving(java.io.File f, <any> filter)
@Deprecated public org.osgi.framework.Bundle installBundle(java.io.File f, boolean start)
OsgiManager#installUploadedBundle(org.apache.brooklyn.api.typereg.ManagedBundle, InputStream)
public java.io.File createTempBundle(java.lang.String nameHint, java.util.jar.Manifest mf, java.util.Map<java.util.zip.ZipEntry,java.io.InputStream> files)
public java.io.File createTempBundle(java.lang.String nameHint, java.util.Map<java.lang.String,java.lang.String> mf, java.util.Map<java.util.zip.ZipEntry,java.io.InputStream> files)
public java.io.File createTempZip(java.lang.String nameHint, java.util.Map<java.util.zip.ZipEntry,java.io.InputStream> files)