Package org.eclnt.util.file
Class DirectoryStampMgmt
java.lang.Object
org.eclnt.util.file.DirectoryStampMgmt
Utility to summarize the content of a directory as one hash code. Each
contained file's name, change date and size is added to one "big" hash code
that represents the directory.
Typical usage scenario: you want to find out if a certain directory has changed. You create a stamp before the potential changes and you create the stamp afterwards - and then compare if the stamps are different.
Of course this is a hash-based calculation of the stamp. The probability that changes are properly detected is high - but not 100%! So you should/ must not use for mission critical aspects!
Typical usage scenario: you want to find out if a certain directory has changed. You create a stamp before the potential changes and you create the stamp afterwards - and then compare if the stamps are different.
Of course this is a hash-based calculation of the stamp. The probability that changes are properly detected is high - but not 100%! So you should/ must not use for mission critical aspects!
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
createStampForDirectory
(String directory) static long
createStampForDirectory
(String directory, Set<String> ignoreNames)
-
Constructor Details
-
DirectoryStampMgmt
public DirectoryStampMgmt()
-
-
Method Details
-
createStampForDirectory
-
createStampForDirectory
- Parameters:
ignoreNames
- Set of file/directory names that are ignored. Each item of the set is a wild card expression (e.g. "*XXX*").
-