All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.archiveaccessor.filestore.ZipBucket

java.lang.Object
   |
   +----com.ibm.archiveaccessor.filestore.ZipBucket

public class ZipBucket
extends Object
implements Cloneable, Serializable
The ZipBucket class holds the contents of a Zip file.


Variable Index

 o empty
Empty token.

Constructor Index

 o ZipBucket()
Creates a bucket with no content.
 o ZipBucket(InputStream)
Creates a bucket with the content of a Zip file.

Method Index

 o clear()
Empties the bucket.
 o clone()
Clones the Zip bucket.
 o exists(String)
Checks if the specified file name is present in the bucket.
 o get(String)
Returns the byte array associated with the given file name.
 o isUseCompression()
Returns switch of use ZIP compression.
 o modified(String)
Returns the time when an entry was last modified.
 o put(String, byte[])
Associates a name and a value.
 o remove(String)
Removes a file from the Zip bucket.
 o resources()
Returns an enumeration of the file names.
 o setUseCompression(boolean)
Turns on/off use of ZIP compression.
 o size()
Returns the number of files in the Zip bucket.
 o zip(OutputStream)
Writes the bucket in Zip file format

Variables

 o empty
 public static final String empty
Empty token.

Constructors

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

 o ZipBucket
 public ZipBucket(InputStream is) throws IOException, ZipException
Creates a bucket with the content of a Zip file.

Parameters:
is - the input stream for the Zip file.
Throws: IOException
may be thrown when reading from the input stream.
Throws: ZipException
may be thrown when processing the contents of the zip.

Methods

 o zip
 public synchronized void zip(OutputStream os) throws IOException, ZipException
Writes the bucket in Zip file format

Parameters:
os - the output stream for the zip file.
Throws: IOException
may be thrown when writting to the output stream.
Throws: ZipException
may be thrown when processing the contents of the zip.
 o clone
 public synchronized Object clone()
Clones the Zip bucket.

Overrides:
clone in class Object
 o exists
 public synchronized boolean exists(String name)
Checks if the specified file name is present in the bucket.

Parameters:
name - a /-seperated path name, completed with file extensions.
Returns:
true, if a specified file exists, false, if a specified file does not exist.
 o clear
 public synchronized void clear()
Empties the bucket.

 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.
 o modified
 public synchronized long modified(String name)
Returns the time when an entry was last modified.

Parameters:
name - a /-seperated path name, complete with file extensions.
Returns:
the time in milliseconds, or 0.
 o put
 public void put(String name,
                 byte value[])
Associates a name and a value.

Parameters:
name - a /-seperated path name, complete with file extensions.
value - the associated byte array.
 o resources
 public Enumeration resources()
Returns an enumeration of the file names.

 o remove
 public synchronized void remove(String name)
Removes a file from the Zip bucket.

Parameters:
name - a /-seperated path name, complete with file extensions.
 o size
 public synchronized int size()
Returns the number of files in the Zip bucket.

Returns:
the number of files in the Zip bucket.
 o setUseCompression
 public synchronized void setUseCompression(boolean aSwitch)
Turns on/off use of ZIP compression.

Parameters:
aSwitch - a switch of using ZIP compression.
 o isUseCompression
 public synchronized boolean isUseCompression()
Returns switch of use ZIP compression.

Returns:
the switch of using ZIP compression.

All Packages  Class Hierarchy  This Package  Previous  Next  Index