SDK Updater: Fetch source XML, display them in tree.

There's a notion of an asynchronous task with a progress bar & status UI.
That's still just experimental. Will need some refactoring, etc.
This commit is contained in:
Raphael
2009-05-19 23:25:54 -07:00
parent cfa6808e6d
commit 08226b31f8
9 changed files with 1042 additions and 169 deletions

View File

@@ -0,0 +1,44 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Eclipse Public License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.eclipse.org/org/documents/epl-v10.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.sdklib.repository;
import java.io.InputStream;
/**
* Constants for the sdk-repository XML Schema
*/
public class SdkRepository {
public static final String NS_SDK_REPOSITORY =
"http://schemas.android.com/sdk/android/repository/1"; //$NON-NLS-1$
public static final String NODE_VERSION = "version"; //$NON-NLS-1$
public static final String NODE_REVISION = "revision"; //$NON-NLS-1$
public static final String NODE_API_LEVEL = "api-level"; //$NON-NLS-1$
public static final String NODE_VENDOR = "vendor"; //$NON-NLS-1$
public static final String NODE_NAME = "name"; //$NON-NLS-1$
public static final String NODE_TOOL = "tool"; //$NON-NLS-1$
public static final String NODE_DOC = "doc"; //$NON-NLS-1$
public static final String NODE_PLATFORM = "platform"; //$NON-NLS-1$
public static final String NODE_ADD_ON = "add-on"; //$NON-NLS-1$
public static final String NODE_SDK_REPOSITORY = "sdk-repository"; //$NON-NLS-1$
public static InputStream getXsdStream() {
return SdkRepository.class.getResourceAsStream("sdk-repository.xsd"); //$NON-NLS-1$
}
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Eclipse Public License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.eclipse.org/org/documents/epl-v10.php
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.sdklib.repository;
import java.io.InputStream;
/**
* Constants for the sdk-repository XML Schema
*/
public class SdkRepositoryConstants {
public static final String NS_SDK_REPOSITORY =
"http://schemas.android.com/sdk/android/repository/1";
public static InputStream getXsdStream() {
return SdkRepositoryConstants.class.getResourceAsStream("sdk-repository.xsd");
}
}

View File

@@ -110,7 +110,7 @@ public class TestSdkRepository extends TestCase {
/** Helper method that returns a validator for our XSD */
private Validator getValidator(CaptureErrorHandler handler) throws SAXException {
InputStream xsdStream = SdkRepositoryConstants.getXsdStream();
InputStream xsdStream = SdkRepository.getXsdStream();
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = factory.newSchema(new StreamSource(xsdStream));
Validator validator = schema.newValidator();