Package de.unirostock.sems.ModelCrawler
Class Config
- java.lang.Object
-
- de.unirostock.sems.ModelCrawler.Config
-
- All Implemented Interfaces:
Serializable
public class Config extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Config.WorkingMode
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Config
defaultConfig()
Loads some default config parameters.static Config
getConfig()
Gets the config instanceList<ModelDatabase>
getDatabases()
String
getEncoding()
String[]
getExtensionBlacklist()
String
getMorreUrl()
static com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
returns the default jackson object mapper for serializing and deserializing json objectschar
getPathSeparator()
String
getPathSeparatorString()
ModelStorage
getStorage()
File
getTempDir()
String
getTempDirPrefix()
String
getUrnNamespace()
File
getWorkingDir()
String
getWorkingDirConfig()
static Config.WorkingMode
getWorkingMode()
Gets the current working mode of the crawlerstatic Config
load(File location)
Loads the config from a Json file.void
save(File location)
Saves the current config to disk.void
setDatabases(List<ModelDatabase> databases)
void
setEncoding(String encoding)
void
setExtensionBlacklist(String[] extensionBlacklist)
void
setMorreUrl(String morreUrl)
void
setPathSeparator(char pathSeparator)
void
setStorage(ModelStorage storage)
void
setTempDir(File tempDir)
void
setTempDirPrefix(String tempDirPrefix)
void
setUrnNamespace(String urnNamespace)
void
setWorkingDir(File workingDir)
void
setWorkingDirConfig(String workingDirConfig)
static void
setWorkingMode(Config.WorkingMode workingMode)
Sets the current working mode of the crawler
-
-
-
Method Detail
-
getConfig
public static Config getConfig()
Gets the config instance- Returns:
- the config
-
getObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
returns the default jackson object mapper for serializing and deserializing json objects- Returns:
- a default jackson object mapper
-
load
public static Config load(File location) throws ConfigurationException
Loads the config from a Json file.- Parameters:
location
- the location- Returns:
- the config as stored in `location`
- Throws:
ConfigurationException
- the configuration exception
-
defaultConfig
public static Config defaultConfig()
Loads some default config parameters.- Returns:
- a default config
-
getWorkingMode
public static Config.WorkingMode getWorkingMode()
Gets the current working mode of the crawler- Returns:
- the current working mode
-
setWorkingMode
public static void setWorkingMode(Config.WorkingMode workingMode)
Sets the current working mode of the crawler- Parameters:
workingMode
- the working mode
-
save
public void save(File location) throws ConfigurationException
Saves the current config to disk.- Parameters:
location
- the location to write to- Throws:
ConfigurationException
- the configuration exception
-
getWorkingDir
public File getWorkingDir()
-
setWorkingDir
public void setWorkingDir(File workingDir)
-
getTempDir
public File getTempDir()
-
setTempDir
public void setTempDir(File tempDir)
-
getEncoding
public String getEncoding()
-
setEncoding
public void setEncoding(String encoding)
-
getPathSeparator
public char getPathSeparator()
-
getPathSeparatorString
public String getPathSeparatorString()
-
setPathSeparator
public void setPathSeparator(char pathSeparator)
-
getExtensionBlacklist
public String[] getExtensionBlacklist()
-
setExtensionBlacklist
public void setExtensionBlacklist(String[] extensionBlacklist)
-
getDatabases
public List<ModelDatabase> getDatabases()
-
setDatabases
public void setDatabases(List<ModelDatabase> databases)
-
getTempDirPrefix
public String getTempDirPrefix()
-
setTempDirPrefix
public void setTempDirPrefix(String tempDirPrefix)
-
getWorkingDirConfig
public String getWorkingDirConfig()
-
setWorkingDirConfig
public void setWorkingDirConfig(String workingDirConfig)
-
getMorreUrl
public String getMorreUrl()
-
setMorreUrl
public void setMorreUrl(String morreUrl)
-
getStorage
public ModelStorage getStorage()
-
setStorage
public void setStorage(ModelStorage storage)
-
getUrnNamespace
public String getUrnNamespace()
-
setUrnNamespace
public void setUrnNamespace(String urnNamespace)
-
-