sfi.director.util.ChecksumEmbedder Class Reference

List of all members.

Detailed Description

Embed file checksums in text file.

Maintains a checksum embedded as a comment within a checksummed text file. This allows to find out if the file has been changed without keeping a backup copy or a checksum in a separate file.


Public Member Functions

 ChecksumEmbedder (File file)
String computeChecksum ()
 Force computation of the files current checksum.
String checksum ()
 Returns the checksum most recently computed.
String fetchChecksum ()
 Extracts the currently embedded checksum from the text file.
String embeddedSum ()
 Returns the most recently fetched checksum.
boolean isAltered ()
 Check if a file has been altered since the last time the checksum was updated.
void embedChecksum (String prefix) throws DirectorException
 Computes the current checksum and updates the copy embedded in the file.

Package Attributes

File file = null
String checksum = null
String extractedSum = null

Static Package Attributes

static final String magic = "nodedirector checksum:"


Constructor & Destructor Documentation

sfi.director.util.ChecksumEmbedder.ChecksumEmbedder File  file  ) 
 


Member Function Documentation

String sfi.director.util.ChecksumEmbedder.checksum  ) 
 

Returns the checksum most recently computed.

If no checksum has ever been computed, invokes computeChecksum first.

String sfi.director.util.ChecksumEmbedder.computeChecksum  ) 
 

Force computation of the files current checksum.

void sfi.director.util.ChecksumEmbedder.embedChecksum String  prefix  )  throws DirectorException
 

Computes the current checksum and updates the copy embedded in the file.

If no checksum has ever been embedded in the file, a new line containing the embedded checksum is added to the file. The string actually written to the file is prefixed with the given prefix string (usually a comment start string).

String sfi.director.util.ChecksumEmbedder.embeddedSum  ) 
 

Returns the most recently fetched checksum.

If fetchChecksum() has not yet been invoked, runs fetchChecksum() first.

String sfi.director.util.ChecksumEmbedder.fetchChecksum  ) 
 

Extracts the currently embedded checksum from the text file.

boolean sfi.director.util.ChecksumEmbedder.isAltered  ) 
 

Check if a file has been altered since the last time the checksum was updated.


Member Data Documentation

String sfi.director.util.ChecksumEmbedder.checksum = null [package]
 

String sfi.director.util.ChecksumEmbedder.extractedSum = null [package]
 

File sfi.director.util.ChecksumEmbedder.file = null [package]
 

final String sfi.director.util.ChecksumEmbedder.magic = "nodedirector checksum:" [static, package]
 


The documentation for this class was generated from the following file:
Generated on Sat Aug 16 01:20:56 2008 for Node Director by  doxygen 1.4.5