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
-
Method Summary
Modifier and TypeMethodDescriptionstatic DirectoryManager
createDirectoryManager
(String directory, boolean readOnly) Creates a newDirectoryManager
for the given directory.static DirectoryManager
createDirectoryManager
(Path path, boolean readOnly) Creates a newDirectoryManager
for the given directory path.static void
setDirectoryManagerClass
(Class<? extends DirectoryManager> clazz) Sets the class ofDirectoryManager
that should be used when creating instances here.
-
Constructor Details
-
DirectoryManagerFactory
public DirectoryManagerFactory()
-
-
Method Details
-
setDirectoryManagerClass
Sets the class ofDirectoryManager
that should be used when creating instances here. This class should provide constructors forPath
andString
versions of the directory.- Parameters:
clazz
- the class to use
-
createDirectoryManager
public static DirectoryManager createDirectoryManager(Path path, boolean readOnly) throws IOException Creates a newDirectoryManager
for 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 newDirectoryManager
for 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
-