private AppSchema buildGMLSchema( String configURL, List<String> gmlSchemas ) throws FeatureStoreException { LOG.debug( "Building application schema from GML schema files." ); AppSchema appSchema = null; try { XMLAdapter resolver = new XMLAdapter(); resolver.setSystemId( configURL ); String[] schemaURLs = new String[gmlSchemas.size()]; int i = 0; for ( String gmlSchema : gmlSchemas ) { schemaURLs[i++] = resolver.resolve( gmlSchema.trim() ).toString(); } GMLAppSchemaReader decoder = null; if ( schemaURLs.length == 1 && schemaURLs[0].startsWith( "file:" ) ) { File file = new File( new URL( schemaURLs[0] ).toURI() ); decoder = new GMLAppSchemaReader( null, null, file ); } else { decoder = new GMLAppSchemaReader( null, null, schemaURLs ); } appSchema = decoder.extractAppSchema(); } catch ( Throwable t ) { t.printStackTrace(); String msg = "Error building GML application schema: " + t.getMessage(); throw new FeatureStoreException( msg ); } LOG.debug( "GML version: " + appSchema.getGMLSchema().getVersion() ); return appSchema; }
try { token = tokenizer.nextToken(); schemaURL = resolve( token ); } catch ( NoSuchElementException e ) { String msg = "Invalid 'xsi:schemaLocation' attribute: namespace '" + nsURI
@Override public CRSStore getCRSStore( URL configURL, Workspace workspace ) throws CRSStoreException { try { PROJ4CRSStoreConfig config = (PROJ4CRSStoreConfig) unmarshall( CONFIG_JAXB_PACKAGE, CONFIG_SCHEMA, new DURL( configURL.toExternalForm() ).openStream(), workspace ); PROJ4CRSStore crsStore = new PROJ4CRSStore( DSTransform.fromSchema( config ) ); ProjFileResource resource = null; XMLAdapter adapter = new XMLAdapter( configURL ); URL fileUrl = adapter.resolve( config.getFile() ); resource = new ProjFileResource( new File( fileUrl.toExternalForm() ) ); crsStore.setResolver( resource ); return crsStore; } catch ( JAXBException e ) { String msg = "Error in proj4 crs store configuration file '" + configURL + "': " + e.getMessage(); LOG.error( msg ); throw new CRSStoreException( msg, e ); } catch ( Exception e ) { String msg = "Error in file declaraition inproj4 crs store configuration file '" + configURL + "': " + e.getMessage(); LOG.error( msg ); throw new CRSStoreException( msg, e ); } }
throw new CRSStoreException( msg ); crsStore = new DeegreeCRSStore( DSTransform.fromSchema( config ), adapter.resolve( parserFile ) ); } catch ( JAXBException e ) { String msg = "Error in crs store configuration file '" + configURL + "': " + e.getMessage();
LOG.info( "Trying to instantiate the default GMLFileResource" ); XMLAdapter adapter = new XMLAdapter( configURL ); URL resolvedGMLFile = adapter.resolve( config.getGMLFile() );