Jalopy 1.0b10

de.hunsicker.jalopy.storage
Class History

java.lang.Object
  |
  +--de.hunsicker.jalopy.storage.History

public final class History
extends Object

History serves as a tracker for file modifications.

The flush() method may be used to synchronously force updates to the backing store. Normal termination of the Java Virtual Machine will not result in the loss of pending updates - an explicit flushing is not required upon termination to ensure that pending updates are made persistent.

This class is thread-safe.

Version:
$Revision: 1.4 $
Author:
Marco Hunsicker

Inner Class Summary
static class History.ChecksumCharArrayWriter
          A writer that calculates a checkum during the writing process.
static class History.Entry
          Represents a history entry.
static class History.Method
          Represents the method used to identify dirty files and changed files.
static class History.Policy
          Represents a history policy.
 
Method Summary
 void add(File file, String packageName, long modification)
          Adds the given file to the history.
 void clear()
          Clears the history.
 void flush()
          Stores the history to the backing store.
 History.Entry get(File file)
          Returns the history entry for the given file.
static History getInstance()
          Returns the sole instance of this class.
 void remove(File file)
          Removes the given file from the history.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static History getInstance()
Returns the sole instance of this class.
Returns:
class instance.

add

public void add(File file,
                String packageName,
                long modification)
         throws IOException
Adds the given file to the history. It will only be added, if it exists and indeed denotes a file (not a directory).
Parameters:
file - file to add.
packageName - the package name of the file to add.
modification - the time the file given was last processed.
Throws:
IOException - if an I/O error occured, which is possible because a canonical pathname will be constructed.

clear

public void clear()
Clears the history.

flush

public void flush()
           throws IOException
Stores the history to the backing store.
Throws:
IOException - if an I/O error occured.

get

public History.Entry get(File file)
                  throws IOException
Returns the history entry for the given file.
Parameters:
file - the file to get the corresponding history entry for.
Returns:
the history entry for the given file or null if no entry for the given file exists.
Throws:
IOException - if an I/O error occured, which is possible because a canonical pathname will be constructed.

remove

public void remove(File file)
            throws IOException
Removes the given file from the history.
Parameters:
file - file to remove.
Throws:
IOException - if an I/O error occured, which is possible because a canonical pathname will be constructed.

Jalopy 1.0b10

Submit a bug or feature.

For further information and documentation, visit the official Jalopy website.
This page generated: November 14 2002