com.android.sdklib.repository
Class SdkRepoConstants

java.lang.Object
  extended by com.android.sdklib.repository.RepoConstants
      extended by com.android.sdklib.repository.SdkRepoConstants

public class SdkRepoConstants
extends RepoConstants

Public constants for the sdk-repository XML Schema.


Field Summary
static java.lang.String NODE_BUILD_TOOL
          A build-tool package.
static java.lang.String NODE_DOC
          A doc package.
static java.lang.String NODE_MAJOR_REV
           
static java.lang.String NODE_MICRO_REV
           
static java.lang.String NODE_MINOR_REV
           
static java.lang.String NODE_PLATFORM
          A platform package.
static java.lang.String NODE_PLATFORM_TOOL
          A platform-tool package.
static java.lang.String NODE_PREVIEW
           
static java.lang.String NODE_SAMPLE
          A sample package.
static java.lang.String NODE_SDK_REPOSITORY
          The root sdk-repository element
static java.lang.String NODE_SOURCE
          A source package.
static java.lang.String NODE_TOOL
          A tool package.
static java.lang.String[] NODES
          List of possible nodes in a repository XML.
static int NS_LATEST_VERSION
          The latest version of the sdk-repository XML Schema.
static java.lang.String NS_PATTERN
          The pattern of our sdk-repository XML namespace.
static int NS_SERVER_MIN_VERSION
          The min version of the sdk-repository XML Schema we'll try to load.
static java.lang.String NS_URI
          The XML namespace of the latest sdk-repository XML.
static java.lang.String URL_DEFAULT_FILENAME
          The default name looked for by SdkSource when trying to load an sdk-repository XML if the URL doesn't match an existing resource.
static java.lang.String URL_FILENAME_PATTERN
          The pattern name looked by SdkSource when trying to load an sdk-repository XML that is specific to a given XSD revision.
static java.lang.String URL_GOOGLE_SDK_SITE
          The URL of the official Google sdk-repository site.
 
Fields inherited from class com.android.sdklib.repository.RepoConstants
ATTR_ARCH, ATTR_ID, ATTR_OS, ATTR_REF, ATTR_TYPE, FD_TEMP, NODE_ABI, NODE_ABI_INCLUDED, NODE_API, NODE_API_LEVEL, NODE_ARCHIVE, NODE_ARCHIVES, NODE_CHECKSUM, NODE_CODENAME, NODE_DESC_URL, NODE_DESCRIPTION, NODE_LAYOUT_LIB, NODE_LIB, NODE_LIBS, NODE_LICENSE, NODE_MIN_API_LEVEL, NODE_MIN_PLATFORM_TOOLS_REV, NODE_MIN_TOOLS_REV, NODE_NAME, NODE_NAME_DISPLAY, NODE_NAME_ID, NODE_OBSOLETE, NODE_OLD_PATHS, NODE_PATH, NODE_PROJECT_FILES, NODE_RELEASE_NOTE, NODE_RELEASE_URL, NODE_REVISION, NODE_SIZE, NODE_SYSTEM_IMAGE, NODE_URL, NODE_USES_LICENSE, NODE_VENDOR, NODE_VENDOR_DISPLAY, NODE_VENDOR_ID, NODE_VERSION, SHA1_CHECKSUM_LEN, SHA1_TYPE
 
Constructor Summary
SdkRepoConstants()
           
 
Method Summary
static java.lang.String getSchemaUri(int version)
          Returns the URI of the SDK Repository schema for the given version number.
static java.io.InputStream getXsdStream(int version)
          Returns a stream to the requested sdk-repository XML Schema.
static boolean versionGreaterOrEqualThan(java.lang.String nsUri, int minVersion)
          Checks whether the schema version is greater or equal to the specified one.
 
Methods inherited from class com.android.sdklib.repository.RepoConstants
getXsdStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NS_LATEST_VERSION

public static final int NS_LATEST_VERSION
The latest version of the sdk-repository XML Schema. Valid version numbers are between 1 and this number, included.

See Also:
Constant Field Values

NS_SERVER_MIN_VERSION

public static final int NS_SERVER_MIN_VERSION
The min version of the sdk-repository XML Schema we'll try to load. When looking for a repository-N.xml on the server, we'll check from NS_LATEST_VERSION down to this revision. We only introduced the "repository-N.xml" pattern start with revision 5, so we know that our server will never contain a repository XML with a schema version lower than this one.

See Also:
Constant Field Values

URL_GOOGLE_SDK_SITE

public static final java.lang.String URL_GOOGLE_SDK_SITE
The URL of the official Google sdk-repository site. The URL ends with a /, allowing easy concatenation.

See Also:
Constant Field Values

URL_DEFAULT_FILENAME

public static final java.lang.String URL_DEFAULT_FILENAME
The default name looked for by SdkSource when trying to load an sdk-repository XML if the URL doesn't match an existing resource.

See Also:
Constant Field Values

URL_FILENAME_PATTERN

public static final java.lang.String URL_FILENAME_PATTERN
The pattern name looked by SdkSource when trying to load an sdk-repository XML that is specific to a given XSD revision.

This must be used with String.format(String, Object...) with one integer parameter between 1 and NS_LATEST_VERSION.

See Also:
Constant Field Values

NS_PATTERN

public static final java.lang.String NS_PATTERN
The pattern of our sdk-repository XML namespace. Matcher's group(1) is the schema version (integer).

See Also:
Constant Field Values

NS_URI

public static final java.lang.String NS_URI
The XML namespace of the latest sdk-repository XML.


NODE_SDK_REPOSITORY

public static final java.lang.String NODE_SDK_REPOSITORY
The root sdk-repository element

See Also:
Constant Field Values

NODE_MAJOR_REV

public static final java.lang.String NODE_MAJOR_REV
See Also:
Constant Field Values

NODE_MINOR_REV

public static final java.lang.String NODE_MINOR_REV
See Also:
Constant Field Values

NODE_MICRO_REV

public static final java.lang.String NODE_MICRO_REV
See Also:
Constant Field Values

NODE_PREVIEW

public static final java.lang.String NODE_PREVIEW
See Also:
Constant Field Values

NODE_PLATFORM

public static final java.lang.String NODE_PLATFORM
A platform package.

See Also:
Constant Field Values

NODE_TOOL

public static final java.lang.String NODE_TOOL
A tool package.

See Also:
Constant Field Values

NODE_PLATFORM_TOOL

public static final java.lang.String NODE_PLATFORM_TOOL
A platform-tool package.

See Also:
Constant Field Values

NODE_BUILD_TOOL

public static final java.lang.String NODE_BUILD_TOOL
A build-tool package.

See Also:
Constant Field Values

NODE_DOC

public static final java.lang.String NODE_DOC
A doc package.

See Also:
Constant Field Values

NODE_SAMPLE

public static final java.lang.String NODE_SAMPLE
A sample package.

See Also:
Constant Field Values

NODE_SOURCE

public static final java.lang.String NODE_SOURCE
A source package.

See Also:
Constant Field Values

NODES

public static final java.lang.String[] NODES
List of possible nodes in a repository XML. Used to populate options automatically in the no-GUI mode.

Constructor Detail

SdkRepoConstants

public SdkRepoConstants()
Method Detail

getXsdStream

public static java.io.InputStream getXsdStream(int version)
Returns a stream to the requested sdk-repository XML Schema.

Parameters:
version - Between 1 and NS_LATEST_VERSION, included.
Returns:
An InputStream object for the local XSD file or null if there is no schema for the requested version.

getSchemaUri

public static java.lang.String getSchemaUri(int version)
Returns the URI of the SDK Repository schema for the given version number.

Parameters:
version - Between 1 and NS_LATEST_VERSION included.

versionGreaterOrEqualThan

public static boolean versionGreaterOrEqualThan(@NonNull
                                                java.lang.String nsUri,
                                                int minVersion)
Checks whether the schema version is greater or equal to the specified one.

Parameters:
nsUri - A non-null sdk-repository schema URI.
minVersion - The minimum version accepted.
Returns:
True if the URI is valid and has at least the required version. False otherwise.