code: protected File toCheckedFile(final String context, final String path) {
          if (path == null || path.trim().isEmpty()) {
              throw new IllegalArgumentException(context + " path cannot be null or blank");
          }
          final File file = new File(path);
          if (!file.isFile()) {
              String message =
                      context + " file does not exist or path does not refer to a file: '" + file.getPath() + "'";
              if (!file.isAbsolute()) {
                  message += " (" + file.getAbsolutePath() + ")";
              }
              throw new IllegalArgumentException(message);
          }
          return file;
      }
docs: Converts the given path to a file. This method checks that the file exists and refers to a file.
  
  @param context The context for what the file is used. This value will be used in case of exceptions.
  @param path The path of the file to use.
  @return The file instance created with the given path.