Class DirectoryManagerFactory

java.lang.Object
org.wikidata.wdtk.util.DirectoryManagerFactory

public class DirectoryManagerFactory extends Object
Static helper class for creating DirectoryManager objects.
Author:
Markus Kroetzsch
  • Constructor Details

    • DirectoryManagerFactory

      public DirectoryManagerFactory()
  • Method Details

    • setDirectoryManagerClass

      public static void setDirectoryManagerClass(Class<? extends DirectoryManager> clazz)
      Sets the class of DirectoryManager that should be used when creating instances here. This class should provide constructors for Path and String versions of the directory.
      Parameters:
      clazz - the class to use
    • createDirectoryManager

      public static DirectoryManager createDirectoryManager(Path path, boolean readOnly) throws IOException
      Creates a new DirectoryManager for the given directory path.
      Parameters:
      path - the directory that the directory manager points to
      readOnly - if false, the directory manager will attempt to create directories when changing to a location that does not exist
      Returns:
      the directory manager
      Throws:
      IOException - if there was an IO error constructing the directory manager
    • createDirectoryManager

      public static DirectoryManager createDirectoryManager(String directory, boolean readOnly) throws IOException
      Creates a new DirectoryManager for the given directory.
      Parameters:
      directory - the directory that the directory manager points to
      readOnly - if false, the directory manager will attempt to create directories when changing to a location that does not exist
      Returns:
      the directory manager
      Throws:
      IOException - if there was an IO error constructing the directory manager