All Packages Class Hierarchy This Package Previous Next Index
Class ORG.opengroup.jar.ManifestSection
java.lang.Object
|
+----ORG.opengroup.jar.ManifestSection
- public class ManifestSection
- extends Object
- implements Serializable, Cloneable
Represents one section of a manifest from a jar file.
ManifestSection()
- Null constructor required for serialization.
ManifestSection(String)
- Normal constructor initializes the section name.
ManifestSection(String[])
- Load a pre-existing manifest section.
add(String, String)
- Add an item to the section.
addHash(byte[])
- Add MD5 and SHA security hashes to the section.
base64Hash(String, byte[])
- Returns a security hash as a base64 ASCII string.
clone()
- Clones the section.
equals(Object)
- Returns true if the section names are equal.
get()
- Returns the contents of the section as an array of strings.
get(String)
- Returns the value of an item in the section, or null.
getFull()
- Returns the contents of the section as an array of strings.
remove(String)
- Remove an item from the section.
validate(byte[])
- Validate the security hash.
ManifestSection
public ManifestSection()
- Null constructor required for serialization.
ManifestSection
public ManifestSection(String id)
- Normal constructor initializes the section name.
- Parameters:
- id - Path name.
ManifestSection
public ManifestSection(String[] header)
- Load a pre-existing manifest section.
Assumption: Continuation lines have the same line delimiter.
- Parameters:
- header - An array of strings in the form "name: value",
or " value".
clone
public Object clone()
- Clones the section.
- Overrides:
- clone in class Object
equals
public boolean equals(Object o)
- Returns true if the section names are equal.
- Parameters:
- o - Another ManifestSection.
- Overrides:
- equals in class Object
remove
public void remove(String name)
- Remove an item from the section.
- Parameters:
- name - Name of the item.
add
public void add(String name,
String value)
- Add an item to the section.
- Parameters:
- name - Name of the item.
- value - Value assigned to the item.
get
public 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.
get
public String[] get()
- Returns the contents of the section as an array of strings.
getFull
public String[] getFull()
- Returns the contents of the section as an array of strings.
(Line delimiters are included.)
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.
addHash
public void addHash(byte[] data)
- Add MD5 and SHA security hashes to the section.
- Parameters:
- data - The data associated with the section.
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