com.zipxap.vfs
Class Entry

java.lang.Object
  extended by com.zipxap.vfs.dataobjects.AEntry
      extended by com.zipxap.vfs.Entry
All Implemented Interfaces:
java.lang.Cloneable

public class Entry
extends AEntry

An Entry is the underlying link between the file system and a VFSFile or VFSRepository.

MilestoneWhoDate, Time
Initial VersionK PenroseJune 2009

** Note that this table is not intended as an exhaustive list of subtle changes. It is intended to list changes that break the compatibility of older code, or major enhancements/rewrites


Constructor Summary
Entry()
           
Entry(LowLevelManager mgr, VFSSector sector)
           
 
Method Summary
 java.io.InputStream getData()
          Retreive an InputStream that provides the data associated with this entry.
 byte[] getDataBytes()
          Retrieve the data contained in this entry as a byte[].
 long getDataLength()
           
 VFSSector getHeaderSector()
          This particular method can be confusing because it returns a header sector, and a header sector contains a data sector and an entry sector...
 java.io.OutputStream getOutputStream()
          Retrieve an OutputStream to replace the data associated with this entry.
 void writeEntry()
          Write the changes to this entry to disk.
 void writeEntry(byte[] data)
          Update this entry and replace the content with the content contained in the specified byte[].
 void writeEntry(java.io.File sourceFile)
          Update this entry and replace the content with the content contained in the specified sourceFile.
 void writeEntry(java.io.InputStream is)
          Replace the content of this entry with the content contained in the specified sourceFile.
 
Methods inherited from class com.zipxap.vfs.dataobjects.AEntry
clone, equals, equals, equals, getCreated, getCreatedId, getLastModified, getLastModifiedId, getName, getOwnerId, getParentId, getType, getUniqueId, hashCode, setCreated, setCreatedId, setLastModified, setLastModifiedId, setName, setOwnerId, setParentId, setType, setUniqueId, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entry

public Entry()

Entry

public Entry(LowLevelManager mgr,
             VFSSector sector)
Method Detail

writeEntry

public void writeEntry()
Write the changes to this entry to disk.


getDataBytes

public byte[] getDataBytes()
Retrieve the data contained in this entry as a byte[].


getData

public java.io.InputStream getData()
Retreive an InputStream that provides the data associated with this entry.


getDataLength

public long getDataLength()
Returns:
the length of the data contained by this entry

getOutputStream

public java.io.OutputStream getOutputStream()
Retrieve an OutputStream to replace the data associated with this entry.


writeEntry

public void writeEntry(java.io.File sourceFile)
Update this entry and replace the content with the content contained in the specified sourceFile.


writeEntry

public void writeEntry(byte[] data)
Update this entry and replace the content with the content contained in the specified byte[].


writeEntry

public void writeEntry(java.io.InputStream is)
Replace the content of this entry with the content contained in the specified sourceFile.


getHeaderSector

public VFSSector getHeaderSector()
This particular method can be confusing because it returns a header sector, and a header sector contains a data sector and an entry sector... The entry sector contains the data of the entry. This makes it confusing.

Returns:
the sector containing the header for this Entry.