|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.sdklib.internal.repository.AddonsListFetcher
public class AddonsListFetcher
Fetches and loads an sdk-addons-list XML.
Such an XML contains a simple list of add-ons site that are to be loaded by default by the SDK Manager.SdkAddonsListConstants.
| Nested Class Summary | |
|---|---|
static class |
AddonsListFetcher.Site
An immutable structure representing an add-on site. |
static class |
AddonsListFetcher.SiteType
|
| Constructor Summary | |
|---|---|
AddonsListFetcher()
|
|
| Method Summary | |
|---|---|
AddonsListFetcher.Site[] |
fetch(java.lang.String url,
DownloadCache cache,
ITaskMonitor monitor)
Fetches the addons list from the given URL. |
protected org.w3c.dom.Document |
getDocument(java.io.InputStream xml,
ITaskMonitor monitor)
Takes an XML document as a string as parameter and returns a DOM for it. |
protected int |
getXmlSchemaVersion(java.io.InputStream xml)
Manually parses the root element of the XML to extract the schema version at the end of the xmlns:sdk="http://schemas.android.com/sdk/android/addons-list/$N" declaration. |
protected AddonsListFetcher.Site[] |
parseAddonsList(org.w3c.dom.Document doc,
java.lang.String nsUri,
java.lang.String baseUrl,
ITaskMonitor monitor)
Parse all sites defined in the Addons list XML and returns an array of sites. |
protected java.lang.String |
validateXml(java.io.InputStream xml,
java.lang.String url,
int version,
java.lang.String[] outError,
java.lang.Boolean[] validatorFound)
Validates this XML against one of the requested SDK Repository schemas. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AddonsListFetcher()
| Method Detail |
|---|
public AddonsListFetcher.Site[] fetch(java.lang.String url,
DownloadCache cache,
ITaskMonitor monitor)
url - The URL of an XML file resource that conforms to the latest sdk-addons-list-N.xsd.
For the default operation, use SdkAddonsListConstants.URL_ADDON_LIST.
Cannot be null.cache - The DownloadCache instance to use. Cannot be null.monitor - A monitor to report errors. Cannot be null.
AddonsListFetcher.Site on success (possibly empty), or null on error.protected int getXmlSchemaVersion(java.io.InputStream xml)
SdkAddonsListConstants.NS_LATEST_VERSION for a valid schema version
or 0 if no schema could be found.
protected java.lang.String validateXml(java.io.InputStream xml,
java.lang.String url,
int version,
java.lang.String[] outError,
java.lang.Boolean[] validatorFound)
protected org.w3c.dom.Document getDocument(java.io.InputStream xml,
ITaskMonitor monitor)
protected AddonsListFetcher.Site[] parseAddonsList(org.w3c.dom.Document doc,
java.lang.String nsUri,
java.lang.String baseUrl,
ITaskMonitor monitor)
doc - The XML DOM to parse.nsUri - The addons-list schema URI of the document.baseUrl - The base URL of the caller (e.g. where addons-list-N.xml was fetched from.)monitor - A non-null monitor to print to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||