Package org.geotools.xml.resolver

Examples of org.geotools.xml.resolver.SchemaCache


     * @param args
     *            ignored
     */
    public static void main(String[] args) {
        // download and cache schemas using app-schema-cache discovered from resource path
        SchemaCache cache = SchemaCache
                .buildAutomaticallyConfiguredUsingFileUrl(AppSchemaValidatorDemo.class
                        .getResource(RESOURCE));
        // no classpath resolution of schemas; cached downloads only
        SchemaResolver resolver = new SchemaResolver(null, false, cache);
        AppSchemaValidator validator = AppSchemaValidator.buildValidator(resolver);
View Full Code Here


    public void cache() throws Exception {
        // intentionally use a non-canonical cache path to ensure these handled correctly
        File cacheDirectory = new File(DataUtilities.urlToFile(AppSchemaConfigurationTest.class
                .getResource("/test-data/cache")), "../cache");
        SchemaResolver resolver = new SchemaResolver(
                new SchemaCache(cacheDirectory, false));
        Configuration configuration = new AppSchemaConfiguration(
                "http://schemas.example.org/cache-test",
                "http://schemas.example.org/cache-test/cache-test.xsd", resolver);
        SchemaIndex schemaIndex = null;
        try {
View Full Code Here

    @Test
    public void catalogCache() throws Exception {
        File cacheDirectory = DataUtilities.urlToFile(AppSchemaConfigurationTest.class
                .getResource("/test-data/cache"));
        SchemaResolver resolver = new SchemaResolver(SchemaCatalog.build(getClass()
                .getResource("/test-data/catalog.xml")), new SchemaCache(cacheDirectory, false));
        Configuration configuration = new AppSchemaConfiguration(
                "http://schemas.example.org/catalog-test",
                "http://schemas.example.org/catalog-test/catalog-cache-test.xsd", resolver);
        SchemaIndex schemaIndex = null;
        try {
View Full Code Here

                cacheDir = tempFolder;
            } else {
                cacheDir = new File(System.getProperty("schema.factory.cache"));
            }
           
            resolver = new SchemaResolver(new SchemaCache(cacheDir, true));
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.geotools.xml.resolver.SchemaCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.