public class ConfigReader extends BaseConfigReader
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_NAME
Default file name of config file
|
static java.lang.String |
DEFAULT_FILM_FILE_PATTERN
Default FILM file rename patter
|
static java.util.List<java.util.regex.Pattern> |
DEFAULT_STRIP_TOKENS
The default strip tokens
|
static java.lang.String |
DEFAULT_TV_FILE_PATTERN
Default TV file rename patter
|
DTD_WEB_LOCATION, SCHEMA_WEB_LOCATION
Constructor and Description |
---|
ConfigReader(java.io.InputStream is)
The constructor used to create a instance of the configuration reader
|
Modifier and Type | Method and Description |
---|---|
java.io.File |
getConfigDir()
Get the location of the media directory
|
java.util.Map<java.lang.String,DBResource> |
getDatabaseResources()
Used to get the database resources
|
static java.io.File |
getDefaultConfigDir()
Used to get the default location of the media manager configuration directory
|
static java.io.File |
getDefaultConfigFile()
Used to the default configuration filename
|
java.util.Collection<java.io.File> |
getMediaDirectories()
Used to get a list of media directory locations
|
MediaDirConfig |
getMediaDirectory(java.io.File directory)
Used to get the configuration for a root media directory
|
java.io.File |
getNativeFolder()
Used to find the native folder.
|
java.util.List<Plugin> |
getPlugins()
Used to get a list of plugins
|
java.util.List<ScriptFile> |
getScriptFiles()
Used to get the scripts
|
SeenDatabaseConfig |
getSeenDatabase()
Used to get the seen database configuration.
|
java.util.Collection<WatchDirConfig> |
getWatchDirectories()
Used to get the watched directory configuration information
|
java.io.File |
getXBMCAddonDir()
Used to get the directory where XBMC addons are installed.
|
java.lang.String |
getXBMCAddonSiteUrl()
Used to get the addon site url
|
java.util.Locale |
getXBMCLocale()
Used to get the locale that should be used when fetching media information from XBMC Addons.
|
java.util.List<IAction> |
loadActionsFromConfigFile(Controller controller,
MediaDirConfig dirConfig)
Used to read the actions from the configuration file
|
java.util.List<ISource> |
loadSourcesFromConfigFile(Controller controller,
MediaDirConfig dirConfig)
Used to read the sources from the configuration file
|
java.util.List<IStore> |
loadStoresFromConfigFile(Controller controller,
MediaDirConfig dirConfig)
Used to read the stores from the configuration file
|
void |
parse()
This will parse the configuration in the XML configuration file and store the
results in this class.
|
protected void |
witeBaseMediaDirSubItem(java.lang.StringBuilder document,
BaseMediaDirSubItem subItem) |
void |
writeConfig(IProgressMonitor monitor,
java.io.File file)
Write the configuration to a file
|
createDocBuilder, createFactory, deleteNode, domToStr, domToStrNoXMLProlog, encodeAttributeValue, firstChild, fixXMl, getAttribute, getElement, getFirstChildElement, getFloatFromXML, getIntegerFromXML, getLastChildElement, getLongFromXML, getSchema, getStringFromXML, getStringFromXMLOrNull, getURLFromXML, getURLFromXMLOrNull, hasNode, parse, parse, parse, quoteXPathQuery, selectChildNodes, selectNodeList, selectSingleNode, strToDom, strToDom, strToDom, writeXML
public static final java.lang.String CONFIG_NAME
public static final java.lang.String DEFAULT_TV_FILE_PATTERN
public static final java.lang.String DEFAULT_FILM_FILE_PATTERN
public static final java.util.List<java.util.regex.Pattern> DEFAULT_STRIP_TOKENS
public ConfigReader(java.io.InputStream is)
is
- The configuration file input streampublic void parse() throws ConfigException
ConfigException
- Thrown if their is a problem parsing the fileprotected void witeBaseMediaDirSubItem(java.lang.StringBuilder document, BaseMediaDirSubItem subItem)
public MediaDirConfig getMediaDirectory(java.io.File directory) throws ConfigException
directory
- the root media directoryConfigException
- Thrown if the configuration can't be foundpublic java.util.List<ISource> loadSourcesFromConfigFile(Controller controller, MediaDirConfig dirConfig) throws ConfigException
controller
- The media controllerdirConfig
- The media directory configurationConfigException
- Thrown if their are any problemspublic java.util.List<IStore> loadStoresFromConfigFile(Controller controller, MediaDirConfig dirConfig) throws ConfigException
controller
- The media controllerdirConfig
- The media directory configurationConfigException
- Thrown if their is any problemspublic java.util.List<IAction> loadActionsFromConfigFile(Controller controller, MediaDirConfig dirConfig) throws ConfigException
controller
- The media controllerdirConfig
- The media directory configurationConfigException
- Thrown if their is any problemspublic java.io.File getXBMCAddonDir() throws ConfigException
ConfigException
- Thrown if their is a problempublic java.io.File getConfigDir() throws ConfigException
ConfigException
- Thrown if their is a problempublic static java.io.File getDefaultConfigDir() throws ConfigException
ConfigException
- Thrown if their is a problempublic java.util.Locale getXBMCLocale()
public java.util.List<Plugin> getPlugins()
public static java.io.File getDefaultConfigFile() throws ConfigException
ConfigException
- Thrown if their are any problemspublic java.util.Collection<java.io.File> getMediaDirectories()
public java.util.Collection<WatchDirConfig> getWatchDirectories()
public java.io.File getNativeFolder()
public java.lang.String getXBMCAddonSiteUrl()
public void writeConfig(IProgressMonitor monitor, java.io.File file) throws ConfigException
monitor
- The progress monitorfile
- File to save the configuration toConfigException
- Thrown if their is a problempublic java.util.Map<java.lang.String,DBResource> getDatabaseResources()
public SeenDatabaseConfig getSeenDatabase()
public java.util.List<ScriptFile> getScriptFiles()