org.cdlib.xtf.cache
Class FileDependency

Object
  extended by Dependency
      extended by FileDependency

public class FileDependency
extends Dependency

This class represents a dependency on a given file. The dependency becomes stale if the file modification time changes after the dependency is created.


Field Summary
private  File file
          The file we're tracking
private  long lastModified
          When the file was modified
 
Constructor Summary
FileDependency(File file)
          Constructor - stores the modification date of the file.
FileDependency(String path)
          Constructor - stores the modification date of the file.
 
Method Summary
 String toString()
          Make a human-readable representation
 boolean validate()
          Checks if this dependency is still valid.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

private File file
The file we're tracking


lastModified

private long lastModified
When the file was modified

Constructor Detail

FileDependency

public FileDependency(File file)
Constructor - stores the modification date of the file.

Parameters:
file - The file to base the dependency on.

FileDependency

public FileDependency(String path)
Constructor - stores the modification date of the file.

Parameters:
path - Full path to the file on which to base the dependency.
Method Detail

validate

public boolean validate()
Checks if this dependency is still valid.

Specified by:
validate in class Dependency
Returns:
true iff the file modification time is unchanged.

toString

public String toString()
Make a human-readable representation

Overrides:
toString in class Object