net.sf.jomic.tools
Class ArchiveCacheEntry

java.lang.Object
  extended by net.sf.jomic.tools.ArchiveCacheEntry

public class ArchiveCacheEntry
extends java.lang.Object

An entry in the cache.

Author:
Thomas Aglassinger.

Constructor Summary
ArchiveCacheEntry(java.io.File newArchiveFile, int newIndex)
           
ArchiveCacheEntry(java.io.File newArchiveFile, long newLastAccessed, long newLastModified, int newIndex)
           
 
Method Summary
 java.io.File getArchiveFile()
          Get the archive file from which the cache was extracted.
 java.io.File getCachedDir(java.io.File baseDir)
          Get directory in baseDir where the files extracted from the archive are located.
 java.lang.String getCachedDirName()
          Get relative directory name where the files extracted from the archive are located.
 int getIndex()
          Get the index in the list of cached archives used to lookup the archive path.
 long getLastAccessed()
          Get the timestamp when the cache was last accessed.
 long getLastModified()
          Get the timestamp when the archive was cached.
 int getLockCount()
          Number of clients that locked this entry to prevent it from being removed.
 long getSize()
          Get the number of bytes used by all files in the archive.
 void lock()
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveCacheEntry

public ArchiveCacheEntry(java.io.File newArchiveFile,
                         int newIndex)

ArchiveCacheEntry

public ArchiveCacheEntry(java.io.File newArchiveFile,
                         long newLastAccessed,
                         long newLastModified,
                         int newIndex)
Method Detail

getArchiveFile

public java.io.File getArchiveFile()
Get the archive file from which the cache was extracted.


getCachedDir

public java.io.File getCachedDir(java.io.File baseDir)
Get directory in baseDir where the files extracted from the archive are located.


getCachedDirName

public java.lang.String getCachedDirName()
Get relative directory name where the files extracted from the archive are located.


getIndex

public int getIndex()
Get the index in the list of cached archives used to lookup the archive path.


getLastAccessed

public long getLastAccessed()
Get the timestamp when the cache was last accessed.


getLastModified

public long getLastModified()
Get the timestamp when the archive was cached.


getLockCount

public int getLockCount()
Number of clients that locked this entry to prevent it from being removed.


getSize

public long getSize()
Get the number of bytes used by all files in the archive. This is not the size it uses on the storage device though because this would depend on the block size of the device.


lock

public void lock()

unlock

public void unlock()