code: public static DirectoryManager createDirectoryManager(Path path,
  			boolean readOnly) throws IOException {
  		try {
  			return dmClass.getConstructor(Path.class, Boolean.class)
  					.newInstance(path, readOnly);
  		} catch (InstantiationException | IllegalAccessException
  				| IllegalArgumentException | NoSuchMethodException
  				| SecurityException e) {
  			throw new RuntimeException(e.toString(), e);
  		} catch (InvocationTargetException e) {
  			if (e.getTargetException() instanceof IOException) {
  				throw (IOException) e.getTargetException();
  			} else {
  				throw new RuntimeException(e.getTargetException().toString(),
  						e.getTargetException());
  			}
  		}
  	}
docs: Creates a new {@link DirectoryManager} for the given directory path.
  
  @param path
  the directory that the directory manager points to
  @param readOnly
  if false, the directory manager will attempt to create
  directories when changing to a location that does not exist
  @return the directory manager
  @throws IOException
  if there was an IO error constructing the directory manager