|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.stanwood.media.xml.XMLParser
org.stanwood.media.setup.BaseConfigReader
org.stanwood.media.setup.ConfigReader
public class ConfigReader
This is used to parse the XML configuration files. These are used to tell the application which stores and sources should be used. Strings in config file can contain variables which get evaulated with the configuration is read.
Field Summary | |
---|---|
static java.lang.String |
CONFIG_NAME
Default file name of config file |
Fields inherited from class org.stanwood.media.xml.XMLParser |
---|
DTD_WEB_LOCATION, SCHEMA_WEB_LOCATION |
Constructor Summary | |
---|---|
ConfigReader(java.io.InputStream is)
The constructor used to create a instance of the configuration reader |
Method Summary | |
---|---|
java.io.File |
getConfigDir()
Get the location of the media directory |
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.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,
SourceConfig subItem)
|
void |
writeConfig(IProgressMonitor monitor,
java.io.File file)
Write the configuration to a file |
Methods inherited from class org.stanwood.media.xml.XMLParser |
---|
createDocBuilder, createFactory, deleteNode, domToStr, encodeAttributeValue, firstChild, getAttribute, getElement, getFirstChildElement, getFloatFromXML, getIntegerFromXML, getLastChildElement, getLongFromXML, getSchema, getStringFromXML, getStringFromXMLOrNull, getURLFromXML, getURLFromXMLOrNull, hasNode, parse, parse, parse, quoteXPathQuery, selectChildNodes, selectNodeList, selectSingleNode, strToDom, strToDom, strToDom, writeXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONFIG_NAME
Constructor Detail |
---|
public ConfigReader(java.io.InputStream is)
is
- The configuration file input streamMethod Detail |
---|
public void parse() throws ConfigException
ConfigException
- Thrown if their is a problem parsing the fileprotected void witeBaseMediaDirSubItem(java.lang.StringBuilder document, SourceConfig subItem)
public MediaDirConfig getMediaDirectory(java.io.File directory) throws ConfigException
directory
- the root media directory
ConfigException
- 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 configuration
ConfigException
- Thrown if their are any problemspublic java.util.List<IStore> loadStoresFromConfigFile(Controller controller, MediaDirConfig dirConfig) throws ConfigException
controller
- The media controllerdirConfig
- The media directory configuration
ConfigException
- Thrown if their is any problemspublic java.util.List<IAction> loadActionsFromConfigFile(Controller controller, MediaDirConfig dirConfig) throws ConfigException
controller
- The media controllerdirConfig
- The media directory configuration
ConfigException
- 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 to
ConfigException
- Thrown if their is a problem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |