All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.archiveaccessor.filestore.JarBucket
java.lang.Object
|
+----com.ibm.archiveaccessor.filestore.ZipBucket
|
+----com.ibm.archiveaccessor.filestore.JarBucket
- public class JarBucket
- extends ZipBucket
The JarBucket class holds the contents of a Jar bucket.
-
JarBucket()
- Creates a bucket with no content.
-
JarBucket(InputStream)
- Creates a bucket with the content of a jar file.
-
clear()
- Empties the jar bucket.
-
clone()
- Clones the bucket.
-
get(String)
- Returns the byte array associated with the given file name.
-
getManifest()
- Returns the manifest.
-
getManifestName()
- Returns the name of a manifest file.
-
getObject(String)
- Either deserialize an existing object or, if there is no such object,
create a new object using the null constructor of the class with the
same name.
-
isCreateManifest()
- Returns switch of creating manifest file.
-
jar(OutputStream)
- Writes the bucket in jar file format
-
put(String, byte[])
- Associates a name and a value.
-
putObject(String, Object)
- Serialize an object and save it as a named resource file in the jar.
-
remove(String)
- Removes a file and its manifest entry from the Jar bucket.
-
setCreateManifest(boolean)
- Turns on/off creating manifest file.
-
setManifest(Manifest)
- Sets the new manifest.
JarBucket
public JarBucket()
- Creates a bucket with no content.
JarBucket
public JarBucket(InputStream is) throws IOException, ZipException
- Creates a bucket with the content of a jar file.
- Parameters:
- is - The input stream for the jar file.
- Throws: IOException
- May be thrown when reading from the
input stream.
- Throws: ZipException
- May be thrown when processing the
contents of the jar.
jar
public synchronized void jar(OutputStream os) throws IOException, ZipException
- Writes the bucket in jar file format
- Parameters:
- os - The output stream for the jar file.
- Throws: IOException
- May be thrown when writting to the
output stream.
- Throws: ZipException
- May be thrown when
processing the contents of the jar.
clone
public synchronized Object clone()
- Clones the bucket.
- Overrides:
- clone in class ZipBucket
getObject
public Object getObject(String name) throws IOException, ClassNotFoundException
- Either deserialize an existing object or, if there is no such object,
create a new object using the null constructor of the class with the
same name.
- Parameters:
- name - A dot-seperated name, with no file extension.
- Throws: IOException
- Error occurred while deserializing.
- Throws: ClassNotFoundException
- No object or class by that name.
get
public synchronized byte[] get(String name)
- Returns the byte array associated with the given file name.
- Parameters:
- name - A /-seperated path name, complete with file
extensions.
- Returns:
- The associated byte array or null.
- Overrides:
- get in class ZipBucket
putObject
public synchronized void putObject(String name,
Object obj) throws IOException
- Serialize an object and save it as a named resource file in the jar.
This is the exact reverse of java.beans.Beans.instantiate.
Security hashes are included in the manifest.
- Parameters:
- name - A dot-seperated name, with no file extension.
The '.'s are replaced by '/' and ".ser" is appended.
- obj - Object to be saved.
- Throws: IOException
- Error occurred while adding the object.
- See Also:
- instantiate
put
public void put(String name,
byte value[])
- Associates a name and a value.
Security hashes are included in the manifest.
- Parameters:
- name - A /-seperated path name, complete with file
extensions.
- value - The associated byte array.
- Overrides:
- put in class ZipBucket
remove
public synchronized void remove(String name)
- Removes a file and its manifest entry from the Jar bucket.
- Parameters:
- name - A /-seperated path name, complete with
file extensions.
- Overrides:
- remove in class ZipBucket
clear
public synchronized void clear()
- Empties the jar bucket.
- Overrides:
- clear in class ZipBucket
setManifest
public synchronized void setManifest(Manifest aManifest)
- Sets the new manifest.
- Parameters:
- aManifest - the new manifest.
getManifest
public synchronized Manifest getManifest()
- Returns the manifest.
- Returns:
- the manifest.
setCreateManifest
public synchronized void setCreateManifest(boolean aSwitch)
- Turns on/off creating manifest file.
- Parameters:
- aSwitch - a switch of creating manifest file.
isCreateManifest
public synchronized boolean isCreateManifest()
- Returns switch of creating manifest file.
- Returns:
- the switch of creating manifest file.
getManifestName
public String getManifestName()
- Returns the name of a manifest file.
- Returns:
- the name of a manifest file.
All Packages Class Hierarchy This Package Previous Next Index