code: public Collection<Image> addImages(File path) throws IOException {
          if (path == null) {
              throw new IllegalArgumentException("Directory path must not be null.");
          } else if (!path.exists()) {
              throw new IllegalArgumentException("The directory " + path.getCanonicalPath() + " does not exist.");
          } else if (!path.isDirectory()) {
              throw new IllegalArgumentException(path.getCanonicalPath() + " is not a directory.");
          }
  
          return addImagesFromPath("", path);
      }
docs: Adds png/jpg/jpeg/gif images in the given directory to the workspace.
  
  @param path          a File descriptor representing a directory on disk
  @return  a Collection of Image objects
  @throws IOException  if the path can't be accessed