code: public static void checkValidFile(final File file) {
          checkNotNull("file", file);
          if (!file.exists()) {
              throw new IllegalArgumentException("The file '" + file + "' does not exist!");
          }
          if (!file.isFile()) {
              throw new IllegalArgumentException("The name '" + file + "' is not a file!");
          }
      }
docs: Check if the argument is an existing file. If the check fails an <code>IllegalArgumentException</code> is thrown.
  
  @param file
  File to check - Cannot be <code>null</code>.