Class FileChecker

java.lang.Object
eu.bandm.tools.util.files.FileChecker

public class FileChecker extends Object
Static methods checking the absence/presence of files, to be used by an application level user interface.
  • Method Details

    • checkInputFiles

      public static <D> void checkInputFiles(MessageReceiver<SimpleMessage<D>> msg, File[] dirs, File... files)
      Checks whether all input files/directories required by an application do exist. The non-dir files checked are naturally always input data, the dirs checked are normally places where to create new output files.
      Type Parameters:
      D - type of the document identifiers.
      Parameters:
      msg - message receiver for error messages.
      dirs - array of directories to check for existance.
      files - array of files to check for existance.
    • checkOutputFiles

      public static <D> void checkOutputFiles(MessageReceiver<SimpleMessage<D>> msg, File... files)
      Checks whether all simple output files of an application do NOT YET exist. Since normally an application does not replace existing directories by new simple files automatically, such pre-existance yields an ERROR, while that of a simple file yields only a warning.
      Type Parameters:
      D - type of the document identifiers.
      Parameters:
      msg - message receiver for error messages.
      files - array of files to check for non-existance.