|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectaQute.bnd.osgi.Jar
public class Jar
| Nested Class Summary | |
|---|---|
static class |
Jar.Compression
|
| Field Summary | |
|---|---|
static Object[] |
EMPTY_ARRAY
|
| Constructor Summary | |
|---|---|
Jar(File f)
|
|
Jar(String name)
|
|
Jar(String string,
File file)
|
|
Jar(String name,
File dirOrFile,
Pattern doNotCopy)
|
|
Jar(String string,
InputStream resourceAsStream)
|
|
Jar(String name,
InputStream in,
long lastModified)
|
|
Jar(String name,
String path)
|
|
| Method Summary | |
|---|---|
boolean |
addAll(Jar src)
|
boolean |
addAll(Jar sub,
Instruction filter)
Add all the resources in the given jar that match the given filter. |
boolean |
addAll(Jar sub,
Instruction filter,
String destination)
Add all the resources in the given jar that match the given filter. |
boolean |
addDirectory(Map<String,Resource> directory,
boolean overwrite)
|
void |
calcChecksums(String[] algorithms)
Calculate the checksums and set them in the manifest. |
void |
close()
|
void |
copy(Jar srce,
String path,
boolean overwrite)
|
void |
ensureManifest()
Make sure we have a manifest |
boolean |
exists(String path)
|
void |
expand(File dir)
Expand the JAR file to a directory. |
String |
getBsn()
Get the jar bsn from the Constants.BUNDLE_SYMBOLICNAME manifest
header. |
URI |
getDataURI(String path,
String mime,
int max)
Return a data uri from the JAR. |
Map<String,Map<String,Resource>> |
getDirectories()
|
Manifest |
getManifest()
|
String |
getName()
|
List<String> |
getPackages()
|
Resource |
getResource(String path)
|
Map<String,Resource> |
getResources()
|
File |
getSource()
|
byte[] |
getTimelessDigest()
|
String |
getVersion()
Get the jar version from the Constants.BUNDLE_VERSION manifest
header. |
Jar.Compression |
hasCompression()
|
boolean |
hasDirectory(String path)
|
boolean |
isManifestFirst()
Answer if the manifest was the first entry |
long |
lastModified()
|
static void |
outputManifest(Manifest manifest,
OutputStream out)
Main function to output a manifest properly in UTF-8. |
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 |
setCompression(Jar.Compression compression)
|
void |
setDigestAlgorithms(String[] algorithms)
|
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. |
void |
setManifest(File file)
|
void |
setManifest(Manifest manifest)
|
void |
setManifestName(String manifestName)
|
void |
setName(String name)
|
void |
setReporter(Reporter reporter)
|
String |
toString()
|
void |
updateModified(long time,
String reason)
|
void |
write(File file)
|
void |
write(OutputStream out)
|
void |
write(String file)
|
static void |
writeManifest(Manifest manifest,
OutputStream out)
|
void |
writeManifest(OutputStream out)
Cleanup the manifest for writing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Object[] EMPTY_ARRAY
| Constructor Detail |
|---|
public Jar(String name)
public Jar(String name,
File dirOrFile,
Pattern doNotCopy)
throws ZipException,
IOException
ZipException
IOException
public Jar(String name,
InputStream in,
long lastModified)
throws IOException
IOException
public Jar(String name,
String path)
throws IOException
IOException
public Jar(File f)
throws IOException
IOException
public Jar(String string,
InputStream resourceAsStream)
throws IOException
IOException
public Jar(String string,
File file)
throws ZipException,
IOException
ZipException
IOException| Method Detail |
|---|
public void setName(String name)
public String toString()
toString in class Object
public boolean putResource(String path,
Resource resource)
public boolean putResource(String path,
Resource resource,
boolean overwrite)
public Resource getResource(String path)
public Map<String,Map<String,Resource>> getDirectories()
public Map<String,Resource> getResources()
public boolean addDirectory(Map<String,Resource> directory,
boolean overwrite)
public Manifest getManifest()
throws Exception
Exceptionpublic boolean exists(String path)
public void setManifest(Manifest manifest)
public void setManifest(File file)
throws IOException
IOExceptionpublic void setManifestName(String manifestName)
public void write(File file)
throws Exception
Exception
public void write(String file)
throws Exception
Exception
public void write(OutputStream out)
throws Exception
Exception
public void writeManifest(OutputStream out)
throws Exception
out - Output
IOException
Exception
public static void writeManifest(Manifest manifest,
OutputStream out)
throws IOException
IOException
public static void outputManifest(Manifest manifest,
OutputStream out)
throws IOException
manifest - The manifest to outputout - The output stream
IOException - when something failspublic String getName()
public boolean addAll(Jar sub,
Instruction filter)
sub - the jarfilter - a pattern that should match the resoures in sub to be added
public boolean addAll(Jar sub,
Instruction filter,
String destination)
sub - the jarfilter - a pattern that should match the resoures in sub to be addedpublic void close()
close in interface Closeablepublic long lastModified()
public void updateModified(long time,
String reason)
public void setReporter(Reporter reporter)
public boolean hasDirectory(String path)
public List<String> getPackages()
public File getSource()
public boolean addAll(Jar src)
public boolean rename(String oldPath,
String newPath)
public Resource remove(String path)
public void setDoNotTouchManifest()
public void calcChecksums(String[] algorithms)
throws Exception
Exception
public String getBsn()
throws Exception
Constants.BUNDLE_SYMBOLICNAME manifest
header.
Constants.BUNDLE_SYMBOLICNAME header, or when the value
of the header is not a valid bsn according to BSN.
Exception - when the jar is closed or when the manifest could not be
retrieved.
public String getVersion()
throws Exception
Constants.BUNDLE_VERSION manifest
header.
Constants.BUNDLE_VERSION header
Exception - when the jar is closed or when the manifest could not be
retrieved.
public void expand(File dir)
throws Exception
dir - the dst directory, is not required to exist
Exception - if anything does not work as expected.
public void ensureManifest()
throws Exception
Exceptionpublic boolean isManifestFirst()
public void copy(Jar srce,
String path,
boolean overwrite)
public void setCompression(Jar.Compression compression)
public Jar.Compression hasCompression()
public URI getDataURI(String path,
String mime,
int max)
throws Exception
jar - The jar to load the data frompath - the path in the jarmime - the mime type
Exceptionpublic void setDigestAlgorithms(String[] algorithms)
public byte[] getTimelessDigest()
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||