aQute.lib.osgi
Class Jar
java.lang.Object
aQute.lib.osgi.Jar
public class Jar
- extends java.lang.Object
Constructor Summary |
Jar(java.io.File jar)
|
Jar(java.lang.String name)
|
Jar(java.lang.String name,
java.io.File dirOrFile)
|
Jar(java.lang.String string,
java.io.InputStream resourceAsStream)
|
Jar(java.lang.String name,
java.io.InputStream in,
long lastModified)
|
Jar(java.lang.String name,
java.lang.String path)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EMPTY_ARRAY
public static final java.lang.Object[] EMPTY_ARRAY
Jar
public Jar(java.lang.String name)
Jar
public Jar(java.lang.String name,
java.io.File dirOrFile)
throws java.util.zip.ZipException,
java.io.IOException
- Throws:
java.util.zip.ZipException
java.io.IOException
Jar
public Jar(java.lang.String name,
java.io.InputStream in,
long lastModified)
throws java.io.IOException
- Throws:
java.io.IOException
Jar
public Jar(java.lang.String name,
java.lang.String path)
throws java.io.IOException
- Throws:
java.io.IOException
Jar
public Jar(java.io.File jar)
throws java.io.IOException
- Throws:
java.io.IOException
Jar
public Jar(java.lang.String string,
java.io.InputStream resourceAsStream)
throws java.io.IOException
- Throws:
java.io.IOException
setName
public void setName(java.lang.String name)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
putResource
public boolean putResource(java.lang.String path,
Resource resource)
putResource
public boolean putResource(java.lang.String path,
Resource resource,
boolean overwrite)
getResource
public Resource getResource(java.lang.String path)
getDirectories
public java.util.Map getDirectories()
getResources
public java.util.Map getResources()
addDirectory
public boolean addDirectory(java.util.Map directory,
boolean overwrite)
getManifest
public java.util.jar.Manifest getManifest()
throws java.io.IOException
- Throws:
java.io.IOException
exists
public boolean exists(java.lang.String path)
setManifest
public void setManifest(java.util.jar.Manifest manifest)
write
public void write(java.io.File file)
throws java.lang.Exception
- Throws:
java.lang.Exception
write
public void write(java.lang.String file)
throws java.lang.Exception
- Throws:
java.lang.Exception
write
public void write(java.io.OutputStream out)
throws java.io.IOException
- Throws:
java.io.IOException
writeManifest
public void writeManifest(java.io.OutputStream out)
throws java.io.IOException
- Throws:
java.io.IOException
getName
public java.lang.String getName()
addAll
public boolean addAll(Jar sub,
java.util.regex.Pattern filter)
- Add all the resources in the given jar that match the given filter.
- Parameters:
sub
- the jarfilter
- a pattern that should match the resoures in sub to be added
close
public void close()
lastModified
public long lastModified()
updateModified
public void updateModified(long time)
setReporter
public void setReporter(aQute.lib.reporter.Reporter reporter)
hasDirectory
public boolean hasDirectory(java.lang.String path)
getPackages
public java.util.List getPackages()
getSource
public java.io.File getSource()
addAll
public boolean addAll(Jar src)
rename
public boolean rename(java.lang.String oldPath,
java.lang.String newPath)
remove
public Resource remove(java.lang.String path)