Class DirectoryStampMgmt

java.lang.Object
org.eclnt.util.file.DirectoryStampMgmt

public class DirectoryStampMgmt extends Object
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!
  • Constructor Details

    • DirectoryStampMgmt

      public DirectoryStampMgmt()
  • Method Details

    • createStampForDirectory

      public static long createStampForDirectory(String directory)
    • createStampForDirectory

      public static long createStampForDirectory(String directory, Set<String> ignoreNames)
      Parameters:
      ignoreNames - Set of file/directory names that are ignored. Each item of the set is a wild card expression (e.g. "*XXX*").