nu.staldal.lagoon.core
Class RemoteFileStorage

java.lang.Object
  extended by nu.staldal.lagoon.core.RemoteFileStorage
All Implemented Interfaces:
FileStorage

public abstract class RemoteFileStorage
extends java.lang.Object
implements FileStorage

Helper class to implement a FileStorage which stores file modification dates locally in the Lagoon working directory.


Constructor Summary
RemoteFileStorage()
           
 
Method Summary
protected  void closeDateFile()
          Close the file to store last update dates locally.
 long fileLastModified(java.lang.String pathname)
          Check if a file exists and when it was last modified.
protected  void fileModified(java.lang.String pathname)
          Signals that a file has been created or updated.
protected  void openDateFile(LagoonContext context)
          Open the file to store last update dates locally.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nu.staldal.lagoon.core.FileStorage
close, createFile, deleteFile, isReentrant, needPassword, open
 

Constructor Detail

RemoteFileStorage

public RemoteFileStorage()
Method Detail

openDateFile

protected void openDateFile(LagoonContext context)
                     throws java.io.IOException
Open the file to store last update dates locally. Invoke this from the FileStorage.open(java.lang.String, nu.staldal.lagoon.core.LagoonContext, java.lang.String) method.

Throws:
java.io.IOException

closeDateFile

protected void closeDateFile()
                      throws java.io.IOException
Close the file to store last update dates locally. Invoke this in the FileStorage.close() method.

Throws:
java.io.IOException

fileModified

protected void fileModified(java.lang.String pathname)
Signals that a file has been created or updated. Invoke this after successful commitment in the OutputHandler.commit() method.


fileLastModified

public final long fileLastModified(java.lang.String pathname)
Check if a file exists and when it was last modified.

Specified by:
fileLastModified in interface FileStorage
Parameters:
pathname - path to the file
Returns:
the time when the file was last modified, or -1 if that information is not avaliable.