code: private static void checkInputFile(final String name, final File inFile) {
  
      String isFailure = null;
  
      if (inFile.isDirectory()) {
        isFailure = "The " + name + " file is a directory!";
      } else if (!inFile.exists()) {
        isFailure = "The " + name + " file does not exist!";
      } else if (!inFile.canRead()) {
        isFailure = "No permissions to read the " + name + " file!";
      }
  
      if (null != isFailure) {
        throw new TerminateToolException(-1,
            isFailure + " Path: " + inFile.getAbsolutePath());
      }
    }
docs: Check input file integrity.
  
  @param name
  the name of the file
  @param inFile
  the file