@@ -26,30 +26,24 @@ public class SdkRepository {
26
26
27
27
/** The URL of the official Google sdk-repository site. */
28
28
public static final String URL_GOOGLE_SDK_REPO_SITE =
29
- "https://dl-ssl.google.com/android/repository/" ; //$NON-NLS-1$
29
+ "https://dl-ssl.google.com/android/repository/" ; //$NON-NLS-1$
30
30
31
31
public static final String URL_DEFAULT_XML_FILE = "repository.xml" ; //$NON-NLS-1$
32
32
33
- /** The XML namespace of the sdk-repository XML version 1.
34
- * @deprecated
35
- */
36
- public static final String NS_SDK_REPOSITORY_1 = getSchemaUri (1 );
37
-
38
- /** The XML namespace of the sdk-repository XML version 2.
39
- * @deprecated
40
- */
41
- public static final String NS_SDK_REPOSITORY_2 = getSchemaUri (2 );
42
-
43
- /** The XML namespace of the latest sdk-repository XML. */
44
- public static final String NS_SDK_REPOSITORY = NS_SDK_REPOSITORY_2 ;
33
+ /** The base of our XML namespace. */
34
+ private static final String NS_SDK_REPOSITORY_BASE =
35
+ "http://schemas.android.com/sdk/android/repository/" ; //$NON-NLS-1$
45
36
46
37
/** The pattern of our XML namespace. */
47
38
public static final String NS_SDK_REPOSITORY_PATTERN =
48
- "http://schemas.android.com/sdk/android/repository/ [1-9][0-9]*" ; //$NON-NLS-1$
39
+ NS_SDK_REPOSITORY_BASE + " [1-9][0-9]*" ; //$NON-NLS-1$
49
40
50
- /** The latest version of the sdk-repository XML Schema, currently 2 .
41
+ /** The latest version of the sdk-repository XML Schema.
51
42
* Valid version numbers are between 1 and this number, included. */
52
- public static final int XSD_LATEST_VERSION = 2 ;
43
+ public static final int NS_LATEST_VERSION = 1 ;
44
+
45
+ /** The XML namespace of the latest sdk-repository XML. */
46
+ public static final String NS_SDK_REPOSITORY = getSchemaUri (NS_LATEST_VERSION );
53
47
54
48
/** The root sdk-repository element */
55
49
public static final String NODE_SDK_REPOSITORY = "sdk-repository" ; //$NON-NLS-1$
@@ -135,8 +129,7 @@ public class SdkRepository {
135
129
/**
136
130
* Returns a stream to the requested repository XML Schema.
137
131
*
138
- * @param version 1 for {@link #NS_SDK_REPOSITORY_1}, 2 for {@link #NS_SDK_REPOSITORY_2}.
139
- * You can use {@link #XSD_LATEST_VERSION} to always get the latest version.
132
+ * @param version Between 1 and {@link #NS_LATEST_VERSION}, included.
140
133
* @return An {@link InputStream} object for the local XSD file or
141
134
* null if there is no schema for the requested version.
142
135
*/
@@ -147,11 +140,10 @@ public static InputStream getXsdStream(int version) {
147
140
148
141
/**
149
142
* Returns the URI of the SDK Repository schema for the given version number.
150
- * @param version Between 1 and {@link #XSD_LATEST_VERSION } included.
143
+ * @param version Between 1 and {@link #NS_LATEST_VERSION } included.
151
144
*/
152
145
public static String getSchemaUri (int version ) {
153
- return String .format ("http://schemas.android.com/sdk/android/repository/%d" , //$NON-NLS-1$
154
- version ); //
146
+ return String .format (NS_SDK_REPOSITORY_BASE + "%d" , version ); //$NON-NLS-1$
155
147
}
156
148
157
149
}
0 commit comments