org.jurvis.util
Class JvCachedFile

java.lang.Object
  extended by org.jurvis.util.JvCachedFile

public class JvCachedFile
extends Object

Information about a file in a JvFileCache.

Author:
Neil W. Weber

Field Summary
protected  File file
           
static int FILE_NAME_MAX
          The maximum length of a file name.
protected  Properties properties
           
protected  File propertiesFile
           
protected  URL url
           
 
Constructor Summary
JvCachedFile(JvFileCache fileCache, URL url)
          Create a new JvCachedFile.
 
Method Summary
 boolean exists()
          Determine if the URL has already been cached.
 String getEtag()
           
 long getExpires()
           
 File getFile()
           
 long getLastModified()
           
 long getLastRequested()
           
 long getLength()
           
 URL getURL()
           
protected  String mapName()
          Map the name of the original file name to a unique cache file name that is filesystem-safe.
protected  void readProperties()
          Read the meta information about the URL.
 void setEtag(String etag)
           
 void setExpires(long expires)
           
 void setLastModified(long lastModified)
           
 void setLastRequested(long lastRequested)
           
 String toString()
           
 void writeProperties()
          Write the meta information about the URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILE_NAME_MAX

public static final int FILE_NAME_MAX
The maximum length of a file name. I actually have no idea what it might be in Windows.

See Also:
Constant Field Values

url

protected URL url

file

protected File file

propertiesFile

protected File propertiesFile

properties

protected Properties properties
Constructor Detail

JvCachedFile

public JvCachedFile(JvFileCache fileCache,
                    URL url)
Create a new JvCachedFile.

Parameters:
fileCache - the file cache this cached file will be part of
url - the URL of the file being cached
Method Detail

mapName

protected String mapName()
Map the name of the original file name to a unique cache file name that is filesystem-safe.

Returns:
the filesystem-safe name

exists

public boolean exists()
Determine if the URL has already been cached.

Returns:
true if the URL has already been cached; false otherwise.

readProperties

protected void readProperties()
Read the meta information about the URL.


writeProperties

public void writeProperties()
Write the meta information about the URL.


getURL

public URL getURL()

getFile

public File getFile()

getLength

public long getLength()

getLastModified

public long getLastModified()

setLastModified

public void setLastModified(long lastModified)

getLastRequested

public long getLastRequested()

setLastRequested

public void setLastRequested(long lastRequested)

getExpires

public long getExpires()

setExpires

public void setExpires(long expires)

getEtag

public String getEtag()

setEtag

public void setEtag(String etag)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.