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.


Constructor Index

 o JarBucket()
Creates a bucket with no content.
 o JarBucket(InputStream)
Creates a bucket with the content of a jar file.

Method Index

 o clear()
Empties the jar bucket.
 o clone()
Clones the bucket.
 o get(String)
Returns the byte array associated with the given file name.
 o getManifest()
Returns the manifest.
 o getManifestName()
Returns the name of a manifest file.
 o 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.
 o isCreateManifest()
Returns switch of creating manifest file.
 o jar(OutputStream)
Writes the bucket in jar file format
 o put(String, byte[])
Associates a name and a value.
 o putObject(String, Object)
Serialize an object and save it as a named resource file in the jar.
 o remove(String)
Removes a file and its manifest entry from the Jar bucket.
 o setCreateManifest(boolean)
Turns on/off creating manifest file.
 o setManifest(Manifest)
Sets the new manifest.

Constructors

 o JarBucket
 public JarBucket()
Creates a bucket with no content.

 o 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.

Methods

 o 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.
 o clone
 public synchronized Object clone()
Clones the bucket.

Overrides:
clone in class ZipBucket
 o 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.
 o 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
 o 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
 o 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
 o 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
 o clear
 public synchronized void clear()
Empties the jar bucket.

Overrides:
clear in class ZipBucket
 o setManifest
 public synchronized void setManifest(Manifest aManifest)
Sets the new manifest.

Parameters:
aManifest - the new manifest.
 o getManifest
 public synchronized Manifest getManifest()
Returns the manifest.

Returns:
the manifest.
 o setCreateManifest
 public synchronized void setCreateManifest(boolean aSwitch)
Turns on/off creating manifest file.

Parameters:
aSwitch - a switch of creating manifest file.
 o isCreateManifest
 public synchronized boolean isCreateManifest()
Returns switch of creating manifest file.

Returns:
the switch of creating manifest file.
 o 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