jarify
Class JarFileEntry

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

 class JarFileEntry
extends java.lang.Object

This class represents a single file within a JarFile. So, the data exchange is done via this wrapper class.


Field Summary
private  byte[] content
          the content of the file in a byte array
protected  java.lang.String name
          Name must be the fully qualified path name to this file (as given in the JAR MANIFEST.)
private  long size
          the uncompressed size of the file
private  java.io.InputStream stream
          an inputstream to read from this file
 
Constructor Summary
JarFileEntry(java.lang.String path, long size, java.io.InputStream stream)
          Create a JarFileEntry to an existing file in a JarFile.
 
Method Summary
 byte[] getContent()
          Returns the content of the file.
 java.lang.String getName()
          Returns the fully qualified path of the file.
 long getSize()
          Returns the size of the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Name must be the fully qualified path name to this file (as given in the JAR MANIFEST.)


stream

private java.io.InputStream stream
an inputstream to read from this file


size

private long size
the uncompressed size of the file


content

private byte[] content
the content of the file in a byte array

Constructor Detail

JarFileEntry

public JarFileEntry(java.lang.String path,
                    long size,
                    java.io.InputStream stream)
Create a JarFileEntry to an existing file in a JarFile.

Parameters:
path - The fully qulified path and name of the file or a URL name.
size - the uncompressed size of the file
stream - the initialized inputstream to read from this file
Method Detail

getName

public java.lang.String getName()
Returns the fully qualified path of the file.

Returns:
The fully qualified path and name of the file.

getSize

public long getSize()
Returns the size of the file.

Returns:
The size of the file.

getContent

public byte[] getContent()
Returns the content of the file.

Returns:
The content of the file as byte[] or null on error.