com.tagtraum.perf.io
Interface FileCache.Entry

Enclosing interface:
FileCache

public static interface FileCache.Entry

FileCache-Entry.


Method Summary
 java.io.File getFile()
          Returns the file object this entry has cached.
 java.io.InputStream getNewInputStream()
          Returns a new InputStream for the cached file.
 int getTimeToLive()
          Returns the length of the validity interval in ms without checking, whether the cached content is still valid.
 boolean isStale()
          Indicates whether the cached content is still valid.
 long lastModified()
          Last modification of this cached file.
 long length()
          Length of this cached file.
 void setTimeToLive(int timeToLive)
          Sets the length of the validity interval in ms without checking, whether the cached content is still valid.
 

Method Detail

getNewInputStream

public java.io.InputStream getNewInputStream()
                                      throws java.io.IOException
Returns a new InputStream for the cached file.

java.io.IOException

getFile

public java.io.File getFile()
Returns the file object this entry has cached.


length

public long length()
Length of this cached file.


lastModified

public long lastModified()
Last modification of this cached file.


setTimeToLive

public void setTimeToLive(int timeToLive)
Sets the length of the validity interval in ms without checking, whether the cached content is still valid. Negative values equate to infinity.


getTimeToLive

public int getTimeToLive()
Returns the length of the validity interval in ms without checking, whether the cached content is still valid. Negative values equate to infinity.


isStale

public boolean isStale()
Indicates whether the cached content is still valid.

Returns:
True, if the timetolive is up and either length or lastmodification of the cached content is not the same as that of the file in the filesystem. False, if either the timetolive is not up yet or it is up, but the cached content is still the same as the content of the original file.


Copyright © 2002 Hendrik Schreiber
http://www.tagtraum.com/performance/
This software can be distributed under LGPL