Package org.wikidata.wdtk.util
Class DirectoryManagerFactory
- java.lang.Object
-
- org.wikidata.wdtk.util.DirectoryManagerFactory
-
public class DirectoryManagerFactory extends Object
Static helper class for creatingDirectoryManagerobjects.- Author:
- Markus Kroetzsch
-
-
Constructor Summary
Constructors Constructor Description DirectoryManagerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
setDirectoryManagerClass
public static void setDirectoryManagerClass(Class<? extends DirectoryManager> clazz)
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
-
-