com.bigzip.plugin
Class ArchiveEntry

java.lang.Object
  |
  +--com.bigzip.plugin.ArchiveEntry

public class ArchiveEntry
extends java.lang.Object

Objects of this classes are provided by Archive objects to allow the user interface to display the details of a file stored in the archive file.


Field Summary
static java.lang.String COMPRESSED_SIZE
          This is the property key used in PropertyChangeEvents when the compressed size changes.
static java.lang.String DETAILS_PROPERTY
          This is the property key used in PropertyChangeEvents when one of the details changes.
static java.lang.String ENTRY_ID_PROPERTY
          This is the property key used in PropertyChangeEvents when the entry id changes.
static java.lang.String ENTRY_TYPE_PROPERTY
          This is the property key used in PropertyChangeEvents when the entry type changes.
static java.lang.String PATHNAME_PROPERTY
          This is the propery key used in PropertyChangeEvents when the pathname of the file changes.
static java.lang.String UNCOMPRESSED_SIZE
          This is the property key used in PropertyChangeEvents when the uncompressed size changes.
 
Constructor Summary
ArchiveEntry(long entryId, java.lang.String pathname, java.lang.Object[] details)
          Creates an archive entry object.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a listener to object.
protected  void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Fires a property change event to all the registered listeners.
 long getCompressedSize()
          Returns the compressed size of the entry.
 java.lang.Object getDetail(int index)
          Returns a specified details of the entry.
 java.lang.Object[] getDetails()
           
 long getEntryId()
           
 java.lang.String getPathname()
           
 long getUncompressedSize()
          Returns the compressed size of the entry.
 boolean isDirectory()
          Returns the entry type, File or Directory.
 boolean isEncrypted()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a registered listener from the list of listenered to be notified when a change occurs in the object.
 void setCompressedSize(long size)
          Sets the compressed size of the entry.
 void setDetails(java.lang.Object[] details)
          Sets the details of the entry.
 void setDirectory(boolean directory)
          Set the entry type to a Directory in stead of a File.
 void setEncrypted(boolean encrypted)
          Set the encryption status of the entry.
 void setEntryId(long entryId)
          Sets the entry id.
 void setPathname(java.lang.String pathname)
          Sets the pathname of the entry.
 void setUncompressedSize(long size)
          Sets the uncompressed size of the entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPRESSED_SIZE

public static final java.lang.String COMPRESSED_SIZE
This is the property key used in PropertyChangeEvents when the compressed size changes.

DETAILS_PROPERTY

public static final java.lang.String DETAILS_PROPERTY
This is the property key used in PropertyChangeEvents when one of the details changes.

ENTRY_ID_PROPERTY

public static final java.lang.String ENTRY_ID_PROPERTY
This is the property key used in PropertyChangeEvents when the entry id changes.

ENTRY_TYPE_PROPERTY

public static final java.lang.String ENTRY_TYPE_PROPERTY
This is the property key used in PropertyChangeEvents when the entry type changes.

PATHNAME_PROPERTY

public static final java.lang.String PATHNAME_PROPERTY
This is the propery key used in PropertyChangeEvents when the pathname of the file changes.

UNCOMPRESSED_SIZE

public static final java.lang.String UNCOMPRESSED_SIZE
This is the property key used in PropertyChangeEvents when the uncompressed size changes.
Constructor Detail

ArchiveEntry

public ArchiveEntry(long entryId,
                    java.lang.String pathname,
                    java.lang.Object[] details)
Creates an archive entry object.
Parameters:
entryId - An id identifing the entry to the Archive.
pathname - The pathname of the entry.
details - The list of details for the entry.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to object. The listener will be notified of changes to the properties of the object.
Parameters:
listener - The PropertyChangeListener to be notified.

firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)
Fires a property change event to all the registered listeners.
Parameters:
propertyName - The name of the property that has changed.
oldValue - The previous value of the property.
newValue - The new value of the property.

getCompressedSize

public long getCompressedSize()
Returns the compressed size of the entry.
Returns:
The compressed size in bytes.

getDetail

public java.lang.Object getDetail(int index)
Returns a specified details of the entry.
Parameters:
index - The index of the required detail.
Returns:
The requested detail of the entry or null if the index does not exist.

getDetails

public java.lang.Object[] getDetails()
Returns:
The list of details of the entry.

getEntryId

public long getEntryId()
Returns:
The entry id.

getPathname

public java.lang.String getPathname()
Returns:
The pathname of the entry.

getUncompressedSize

public long getUncompressedSize()
Returns the compressed size of the entry.
Returns:
The compressed size in bytes.

isDirectory

public boolean isDirectory()
Returns the entry type, File or Directory.
Returns:
True if the entry is a directory. False if it is a file.

isEncrypted

public boolean isEncrypted()
Returns:
true if the entry is encrypted.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a registered listener from the list of listenered to be notified when a change occurs in the object.
Parameters:
listener - The PropertyChangeListener to be removed.

setCompressedSize

public void setCompressedSize(long size)
Sets the compressed size of the entry.
Parameters:
size - The compressed size in bytes.

setDetails

public void setDetails(java.lang.Object[] details)
Sets the details of the entry.
Parameters:
details - The list of the entry's details.

setDirectory

public void setDirectory(boolean directory)
Set the entry type to a Directory in stead of a File.
Parameters:
directory - The entry is a directory.

setEncrypted

public void setEncrypted(boolean encrypted)
Set the encryption status of the entry.
Parameters:
encrypted - The entry is encrypted.

setEntryId

public void setEntryId(long entryId)
Sets the entry id.
Parameters:
entryId - The entry id.

setPathname

public void setPathname(java.lang.String pathname)
Sets the pathname of the entry.
Parameters:
pathname - The entry's pathname.

setUncompressedSize

public void setUncompressedSize(long size)
Sets the uncompressed size of the entry.
Parameters:
size - The uncompressed size in bytes.