docs: private static void checkDir(File dir) throws FileNotFoundException, IllegalArgumentException {
          if (!dir.exists())
              throw new FileNotFoundException(dir.getAbsolutePath());
          if (!dir.isDirectory())
              throw new IllegalArgumentException("The provided File object is not a directory: " + dir.getAbsolutePath());
      }