Package org.wikidata.wdtk.util
Class DirectoryManagerFactory
java.lang.Object
org.wikidata.wdtk.util.DirectoryManagerFactory
Static helper class for creating
DirectoryManager objects.- Author:
- Markus Kroetzsch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DirectoryManagercreateDirectoryManager(String directory, boolean readOnly) Creates a newDirectoryManagerfor the given directory.static DirectoryManagercreateDirectoryManager(Path path, boolean readOnly) Creates a newDirectoryManagerfor the given directory path.static voidsetDirectoryManagerClass(Class<? extends DirectoryManager> clazz) Sets the class ofDirectoryManagerthat should be used when creating instances here.
-
Constructor Details
-
DirectoryManagerFactory
public DirectoryManagerFactory()
-
-
Method Details
-
setDirectoryManagerClass
Sets the class ofDirectoryManagerthat should be used when creating instances here. This class should provide constructors forPathandStringversions of the directory.- Parameters:
clazz- the class to use
-
createDirectoryManager
public static DirectoryManager createDirectoryManager(Path path, boolean readOnly) throws IOException Creates a newDirectoryManagerfor the given directory path.- Parameters:
path- the directory that the directory manager points toreadOnly- 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 newDirectoryManagerfor the given directory.- Parameters:
directory- the directory that the directory manager points toreadOnly- 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
-