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.
-
empty
- Empty token.
-
ZipBucket()
- Creates a bucket with no content.
-
ZipBucket(InputStream)
- Creates a bucket with the content of a Zip file.
-
clear()
- Empties the bucket.
-
clone()
- Clones the Zip bucket.
-
exists(String)
- Checks if the specified file name is present in the bucket.
-
get(String)
- Returns the byte array associated with the given file name.
-
isUseCompression()
- Returns switch of use ZIP compression.
-
modified(String)
- Returns the time when an entry was last modified.
-
put(String, byte[])
- Associates a name and a value.
-
remove(String)
- Removes a file from the Zip bucket.
-
resources()
- Returns an enumeration of the file names.
-
setUseCompression(boolean)
- Turns on/off use of ZIP compression.
-
size()
- Returns the number of files in the Zip bucket.
-
zip(OutputStream)
- Writes the bucket in Zip file format
empty
public static final String empty
- Empty token.
ZipBucket
public ZipBucket()
- Creates a bucket with no content.
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.
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.
clone
public synchronized Object clone()
- Clones the Zip bucket.
- Overrides:
- clone in class Object
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.
clear
public synchronized void clear()
- Empties the bucket.
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.
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.
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.
resources
public Enumeration resources()
- Returns an enumeration of the file names.
remove
public synchronized void remove(String name)
- Removes a file from the Zip bucket.
- Parameters:
- name - a /-seperated path name, complete with file
extensions.
size
public synchronized int size()
- Returns the number of files in the Zip bucket.
- Returns:
- the number of files in the Zip bucket.
setUseCompression
public synchronized void setUseCompression(boolean aSwitch)
- Turns on/off use of ZIP compression.
- Parameters:
- aSwitch - a switch of using ZIP compression.
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