aQute.lib.osgi
Class Jar
public
class
Jar
extends Object
implements Closeable
Constructor Summary |
| Jar(String name) |
| Jar(String name, File dirOrFile) |
| Jar(String name, InputStream in, long lastModified) |
| Jar(String name, String path) |
| Jar(File jar) |
| Jar(String string, InputStream resourceAsStream) |
Method Summary |
boolean | addAll(Jar sub, Pattern filter)
Add all the resources in the given jar that match the given filter.
|
boolean | addAll(Jar src) |
boolean | addDirectory(Map<String,Resource> directory, boolean overwrite) |
void | close() |
boolean | exists(String path) |
Map<String,Map<String,Resource>> | getDirectories() |
Manifest | getManifest() |
String | getName() |
List<String> | getPackages() |
Resource | getResource(String path) |
Map<String,Resource> | getResources() |
File | getSource() |
boolean | hasDirectory(String path) |
long | lastModified() |
boolean | putResource(String path, Resource resource) |
boolean | putResource(String path, Resource resource, boolean overwrite) |
Resource | remove(String path) |
boolean | rename(String oldPath, String newPath) |
void | setDoNotTouchManifest()
Make sure nobody touches the manifest! |
void | setManifest(Manifest manifest) |
void | setName(String name) |
void | setNoManifest(boolean b) |
void | setReporter(Reporter reporter) |
String | toString() |
void | updateModified(long time, String reason) |
void | write(File file) |
void | write(String file) |
void | write(OutputStream out) |
void | writeManifest(OutputStream out)
Cleanup the manifest for writing. |
static void | writeManifest(Manifest manifest, OutputStream out) |
public static final Object[] EMPTY_ARRAY
public Jar(String name)
public Jar(String name, File dirOrFile)
public Jar(String name, InputStream in, long lastModified)
public Jar(String name, String path)
public Jar(File jar)
public Jar(String string, InputStream resourceAsStream)
public boolean addAll(
Jar sub, Pattern filter)
Add all the resources in the given jar that match the given filter.
Parameters: sub
the jar filter
a pattern that should match the resoures in sub to be added
public boolean addAll(
Jar src)
public boolean addDirectory(Map<String,
Resource> directory, boolean overwrite)
public void close()
public boolean exists(String path)
public Map<String,Map<String,
Resource>> getDirectories()
public Manifest getManifest()
public String getName()
public List<String> getPackages()
public
Resource getResource(String path)
public Map<String,
Resource> getResources()
public File getSource()
public boolean hasDirectory(String path)
public long lastModified()
public boolean putResource(String path,
Resource resource)
public boolean putResource(String path,
Resource resource, boolean overwrite)
public boolean rename(String oldPath, String newPath)
public void setDoNotTouchManifest()
Make sure nobody touches the manifest! If the bundle is signed, we do not
want anybody to touch the manifest after the digests have been
calculated.
public void setManifest(Manifest manifest)
public void setName(String name)
public void setNoManifest(boolean b)
public void setReporter(Reporter reporter)
public String toString()
public void updateModified(long time, String reason)
public void write(File file)
public void write(String file)
public void write(OutputStream out)
public void writeManifest(OutputStream out)
Cleanup the manifest for writing. Cleaning up consists of adding a space
after any \n to prevent the manifest to see this newline as a delimiter.
Parameters: out
Output
Throws: IOException
public static void writeManifest(Manifest manifest, OutputStream out)