All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.archiveaccessor.filestore.ManifestSection

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

public class ManifestSection
extends Object
implements Serializable, Cloneable
The ManifestSection class represents one section of a manifest from a Jar file.


Constructor Index

 o ManifestSection()
Null constructor required for serialization.
 o ManifestSection(String)
Normal constructor initializes the section name.
 o ManifestSection(String[])
Loads a pre-existing manifest section.

Method Index

 o add(String, String)
Adds an item to the section.
 o addHash(byte[])
Add MD5 and SHA security hashes to the section.
 o base64Hash(String, byte[])
Returns a security hash as a base64 ASCII string.
 o clone()
Clones the section.
 o equals(Object)
Returns true if the section names are equal.
 o get()
Returns the contents of the section as an array of strings.
 o get(String)
Returns the value of an item in the section, or null.
 o hashCode()
Returns a hash code value for this section.
 o remove(String)
Removes an item from the section.
 o validate(byte[])
Validate the security hash.

Constructors

 o ManifestSection
 public ManifestSection()
Null constructor required for serialization.

 o ManifestSection
 public ManifestSection(String id)
Normal constructor initializes the section name.

Parameters:
id - path name.
 o ManifestSection
 public ManifestSection(String header[])
Loads a pre-existing manifest section.

Parameters:
header - an array of strings in the form "name: value", or " value".

Methods

 o clone
 public synchronized Object clone()
Clones the section.

Overrides:
clone in class Object
 o equals
 public synchronized boolean equals(Object o)
Returns true if the section names are equal.

Parameters:
o - Another ManifestSection.
Overrides:
equals in class Object
 o hashCode
 public synchronized int hashCode()
Returns a hash code value for this section.

Overrides:
hashCode in class Object
 o remove
 public synchronized void remove(String name)
Removes an item from the section.

Parameters:
name - name of the item.
 o add
 public synchronized void add(String name,
                              String value)
Adds an item to the section.

Parameters:
name - name of the item.
value - value assigned to the item.
 o get
 public synchronized String get(String name)
Returns the value of an item in the section, or null.

Parameters:
name - Name of the item.
Returns:
The assigned value.
 o get
 public synchronized String[] get()
Returns the contents of the section as an array of strings.

 o base64Hash
 public static String base64Hash(String algorithm,
                                 byte data[]) throws NoSuchAlgorithmException
Returns a security hash as a base64 ASCII string.

Parameters:
algorithm - security hash algorithm name.
data - the data to be hashed.
Throws: NoSuchAlgorithmException
unimplimented security hash.
 o addHash
 public void addHash(byte data[])
Add MD5 and SHA security hashes to the section.

Parameters:
data - the data associated with the section.
 o validate
 public boolean validate(byte data[]) throws NoSuchAlgorithmException
Validate the security hash.

Parameters:
data - the data associated with the section.
Returns:
true when valid.
Throws: NoSuchAlgorithmException
unimplimented security hash.

All Packages  Class Hierarchy  This Package  Previous  Next  Index