jarify
Class JarManifest

java.lang.Object
  extended by jarify.JarFileEntry
      extended by jarify.JarManifest
Direct Known Subclasses:
JarSignatureFile

 class JarManifest
extends JarFileEntry

The Manifest of a JarFile. It contains of Manifest Entries.


Nested Class Summary
private  class JarManifest.EntryData
          This is an entry in the manifest.
 
Field Summary
protected  java.lang.String contentStrRaw
          the content of the manifest as String
private  java.util.Hashtable entries
           
private  java.util.Vector fileNameList
           
protected  java.lang.String newLine
          the character(s) of the newline used in this file
 
Fields inherited from class jarify.JarFileEntry
name
 
Constructor Summary
JarManifest(long size, java.io.InputStream stream)
          Constructor
 
Method Summary
 java.lang.String getDigest(JarFileEntry file, java.lang.String digestID)
          Returns the digest for a file.
 java.lang.String getDigest(java.lang.String fileName, java.lang.String digestID)
          Returns the digest for a file.
 java.util.Vector getDigestList(java.lang.String fileName)
           
 byte[] getEntry(java.lang.String fileName)
          Get the Manifest Entry of a file.
 java.util.Vector getFileNames()
          Returns all file names as String.
protected  void init()
          Reads the content of the file into a string variable.
private  void parse()
           
 
Methods inherited from class jarify.JarFileEntry
getContent, getName, getSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entries

private java.util.Hashtable entries

fileNameList

private java.util.Vector fileNameList

contentStrRaw

protected java.lang.String contentStrRaw
the content of the manifest as String


newLine

protected java.lang.String newLine
the character(s) of the newline used in this file

Constructor Detail

JarManifest

public JarManifest(long size,
                   java.io.InputStream stream)
Constructor

Parameters:
size - The size of the Manifest file.
stream - An InputStream that is used for reading.
Method Detail

init

protected void init()
Reads the content of the file into a string variable. And finds out what is the new line character in this file.


parse

private void parse()

getFileNames

public java.util.Vector getFileNames()
Returns all file names as String. The paths are relative to the root of the jar file, or URIs!

Returns:
a list containing all files that are listed in the manifest file as string objects or null if there was an error!

getDigest

public java.lang.String getDigest(JarFileEntry file,
                                  java.lang.String digestID)
Returns the digest for a file. NOTE: You have to specify the full digest string in the parameter digestID. This String is used to find the digest in the manifest file.

Parameters:
file - a JarFileEntry
digestID - Something like SHA1-Digest: or MD5-Digist:
Returns:
The digest for this file in a String format or null if file or digest were not found.
See Also:
JarContants

getDigest

public java.lang.String getDigest(java.lang.String fileName,
                                  java.lang.String digestID)
Returns the digest for a file. NOTE: You have to specify the full digest string in the parameter digestID. This String is used to find the digest in the manifest file.

Parameters:
fileName - the file name of the JarFileEntry
digestID - Something like SHA1-Digest: or MD5-Digist:
Returns:
The digest for this file in a String format or null if file or digest were not found.
See Also:
JarContants

getEntry

public byte[] getEntry(java.lang.String fileName)
Get the Manifest Entry of a file.

Parameters:
fileName -
Returns:
file entry as byte array

getDigestList

public java.util.Vector getDigestList(java.lang.String fileName)