Methods Summary |
---|
public void | close()close the abstract archive
if (jos!=null) {
jos.flush();
jos.finish();
jos.close();
jos=null;
}
|
public void | closeEntry(AbstractArchive os)close a previously returned @see java.io.OutputStream returned
by an addEntry call
if (os instanceof OutputJarArchive) {
((OutputJarArchive) os).jos.flush();
((OutputJarArchive) os).jos.finish();
}
jos.closeEntry();
|
public void | closeEntry()closes the current entry
if (jos!=null) {
jos.flush();
jos.closeEntry();
}
|
public void | create(java.lang.String path)creates a new abstract archive with the given path
archiveUri = path;
File file = new File(path);
// if teh file exists, we delete it first
if (file.exists()) {
file.delete();
}
FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(fos);
jos = new ZipOutputStream(bos);
|
public boolean | delete()
throw new UnsupportedOperationException("Cannot read from a JAR archive open for writing");
|
public java.util.Enumeration | entries()
return entries.elements();
|
public java.util.Enumeration | entries(java.util.Enumeration embeddedArchives)
return entries();
|
public boolean | exists()
throw new UnsupportedOperationException("Cannot read from a JAR archive open for writing");
|
public long | getArchiveSize()Get the size of the archive
return -1;
|
public java.lang.String | getArchiveUri()
return archiveUri;
|
public AbstractArchive | getEmbeddedArchive(java.lang.String name)
OutputStream os = putNextEntry(name);
ZipOutputStream jos = new ZipOutputStream(os);
OutputJarArchive ja = new OutputJarArchive();
ja.archiveUri = name;
ja.jos = jos;
return ja;
|
public java.io.InputStream | getEntry(java.lang.String name)
throw new UnsupportedOperationException("Cannot read from a JAR archive open for writing");
|
public java.util.jar.Manifest | getManifest()
if (manifest!=null) {
manifest = new Manifest();
}
return manifest;
|
public java.net.URI | getURI()
try {
return ArchiveFactory.prepareArchiveURI(getArchiveUri());
} catch(java.net.URISyntaxException e) {
return null;
} catch (UnsupportedEncodingException uee) {
return null;
} catch (IOException ioe) {
return null;
}
|
public void | open(java.lang.String path)Open an abstract archive
throw new UnsupportedOperationException("Cannot read jar files");
|
public java.io.OutputStream | putNextEntry(java.lang.String name)
if (jos!=null) {
ZipEntry ze = new ZipEntry(name);
jos.putNextEntry(ze);
entries.add(name);
}
return jos;
|
public boolean | renameTo(java.lang.String name)
throw new UnsupportedOperationException("Cannot read from a JAR archive open for writing");
|