public class XBMCAddonManager extends java.lang.Object implements IContentFetcher
Modifier | Constructor and Description |
---|---|
|
XBMCAddonManager(ConfigReader config)
Used to create a instance of the addon manager
|
protected |
XBMCAddonManager(ConfigReader config,
IXBMCUpdater updater,
boolean doInit) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
downloadFile(java.net.URL url,
java.io.File newAddon)
This will copy a file from the web to a destination file on the local system
|
XBMCAddon |
getAddon(java.lang.String id)
Used to get a addon
|
java.lang.String |
getDefaultAddonID(Mode mode)
Used to get the default source ID
|
Stream |
getStreamToURL(java.net.URL url)
This will get a input stream to the contents pointed at by the URL
|
IXBMCUpdater |
getUpdater()
Used to get the XBMC updater
|
protected void |
init(IXBMCUpdater updater) |
boolean |
isFirstTime()
Checks if this is the first time the application has been run.
|
java.util.Set<java.lang.String> |
listAddons()
Used to get a list of addon ID's
|
void |
registerAddons()
Used to register all the XBMC addons that are found in the addon directory
|
void |
unregisterAddons()
Used to unregister all XBMC addons with the manager
|
protected XBMCAddonManager(ConfigReader config, IXBMCUpdater updater, boolean doInit) throws XBMCException
XBMCException
public XBMCAddonManager(ConfigReader config) throws XBMCException
config
- The configurationXBMCException
- Thrown if their is a problem creating the addon managerprotected void init(IXBMCUpdater updater) throws XBMCException
XBMCException
public IXBMCUpdater getUpdater()
public void unregisterAddons()
public XBMCAddon getAddon(java.lang.String id) throws XBMCException
id
- The ID of the addon to getXBMCException
- Thrown if the addon could not be foundpublic void registerAddons() throws XBMCException
XBMCException
- Thrown if their is a problempublic Stream getStreamToURL(java.net.URL url) throws SourceException
getStreamToURL
in interface IContentFetcher
url
- The URLSourceException
- thrown if their is a problem getting the streampublic java.lang.String getDefaultAddonID(Mode mode) throws XBMCException
mode
- The mode that were looking for a source id inXBMCException
- Thrown if their is a problem getting the default source IDpublic java.lang.String downloadFile(java.net.URL url, java.io.File newAddon) throws java.io.IOException
url
- The URL to read from the file fromnewAddon
- The file to be created on the location systemjava.io.IOException
- Thrown if their is a problem reading or wring the filepublic java.util.Set<java.lang.String> listAddons()
public boolean isFirstTime() throws XBMCException
XBMCException
- Thrown if their are any problems