Class RequireFilesExist

All Implemented Interfaces:
EnforcerRuleBase

@Named("requireFilesExist") public final class RequireFilesExist extends AbstractRequireFiles
The Class RequireFilesExist.
  • Constructor Details

    • RequireFilesExist

      public RequireFilesExist()
  • Method Details

    • checkFile

      boolean checkFile(File file)
      Description copied from class: AbstractRequireFiles
      Check one file.
      Specified by:
      checkFile in class AbstractRequireFiles
      Parameters:
      file - the file
      Returns:
      true if successful
    • getErrorMsg

      String getErrorMsg()
      Description copied from class: AbstractRequireFiles
      Gets the error msg.
      Specified by:
      getErrorMsg in class AbstractRequireFiles
      Returns:
      the error msg
    • osIndependentNameMatch

      private boolean osIndependentNameMatch(File file, boolean defaultValue)
      OSes like Windows are case insensitive, so this method will compare the file path with the actual path. A simple File.exists() is not enough for such OS.
      Parameters:
      file - the file to verify
      defaultValue - value to return in case an IO exception occurs, should never happen as the file already exists
      Returns: