private URI resolveURI( String fileName ) { URI resolve = null; try { URL url = metadata.getLocation().resolveToUrl( fileName ); resolve = url.toURI(); } catch ( URISyntaxException e ) { LOG.warn( "Error while resolving url for file: " + fileName + "." ); } return resolve; }
private URI resolveURI( String fileName ) { URI resolve = null; try { URL url = metadata.getLocation().resolveToUrl( fileName ); resolve = url.toURI(); } catch ( URISyntaxException e ) { LOG.warn( "Error while resolving url for file: " + fileName + "." ); } return resolve; }
private URL resolveImageUrl( String file ) throws MalformedURLException { if ( context.location != null ) return context.location.resolveToUrl( file ); return resolve( file, in ); }
URL url; if ( context.location != null ) { url = context.location.resolveToUrl( str ); } else { url = resolve( str, in );
/** * @param in * @return the resolved href attribute * @throws XMLStreamException * @throws MalformedURLException */ public URL parseOnlineResource( XMLStreamReader in ) throws XMLStreamException, MalformedURLException { if ( !require( in, "OnlineResource" ) ) { return null; } String url = in.getAttributeValue( XLNNS, "href" ); URL resolved; if ( location != null ) { resolved = location.resolveToUrl( url ); } else { resolved = XMLStreamUtils.resolve( url, in ); } in.nextTag(); in.require( END_ELEMENT, null, "OnlineResource" ); return resolved; }
/** * @param configAdapter */ private void initCopyright( ResourceLocation<?> location ) { if ( serviceConfiguration.getCopyright() != null ) { Copyright copy = serviceConfiguration.getCopyright(); Image image = copy.getImage(); if ( image != null ) { String url = image.getUrl(); if ( url != null && !"".equals( url ) ) { try { URL resolved = location.resolveToUrl( url ); File f = new File( resolved.toURI() ); this.copyrightKey = TexturePool.addTexture( f ); Double cs = copy.getPercentageOfResult(); if ( cs != null ) { // this.copyrighScale = copy.getPercentageOfResult() * 0.01; LOG.warn( "Copyright scaling will be ignored, please make your copyright image your preferred size." ); } } catch ( URISyntaxException e ) { LOG.error( "Unable to load copyright image from: " + url + " because: " + e.getLocalizedMessage() ); LOG.trace( "Stack trace:", e ); } } } } }
@Override public BatchedMTStore build() { BatchedMTStore bs = null; try { CRSManager.getCRSRef( config.getCrs() ); URL dir = metadata.getLocation().resolveToUrl( config.getDirectory() ); int maxDirectMem = config.getMaxDirectMemory().intValue(); bs = new BatchedMTFileStore( dir, maxDirectMem, metadata ); } catch ( Exception e ) { throw new ResourceInitException( "Unable to build batched MT store: " + e.getLocalizedMessage(), e ); } return bs; }
private WMTSClient createClient() throws OWSExceptionReport, XMLStreamException, IOException { URL capas = metadata.getLocation().resolveToUrl( config.getCapabilitiesDocumentLocation().getLocation() ); OwsHttpClient httpClient = createOwsHttpClient( config ); return new WMTSClient( capas, httpClient ); }
dir = storeConfig.getAdhocQueriesDirectory(); if ( dir != null ) { URL resolved = metadata.getLocation().resolveToUrl( dir ); queriesDir = new File( resolved.toURI() ); try { if ( profile != null ) { URL resolved = metadata.getLocation().resolveToUrl( profile ); File f = new File( resolved.toURI() ); lastModified = new Date( f.lastModified() );
return null; URL styleFile = location.resolveToUrl( unresolved ); InputStream styleStream = null; Style style;
extendedCapabilities = metadata.getLocation().resolveToUrl( jaxbConfig.getExtendedCapabilities() ); if ( extendedCapabilities == null ) { LOG.warn( "Could not resolve path to extended capabilities : " + extendedCapabilities
private void addSupportedCapabilitiesFormats( DeegreeWMS conf ) throws InstantiationException, IllegalAccessException { if ( conf.getGetCapabilitiesFormats() != null ) { for ( GetCapabilitiesFormat getCapabilitiesFormat : conf.getGetCapabilitiesFormats().getGetCapabilitiesFormat() ) { if ( getCapabilitiesFormat.getXSLTFile() != null ) { String format = getCapabilitiesFormat.getFormat(); String xsltFile = getCapabilitiesFormat.getXSLTFile(); URL xsltUrl = metadata.getLocation().resolveToUrl( xsltFile ); capabilitiesManager.addOrReplaceXsltFormat( format, xsltUrl, workspace ); } } } }
private void addSupportedExceptionFormats( DeegreeWMS conf ) throws InstantiationException, IllegalAccessException { if ( conf.getExceptionFormats() != null ) { for ( ExceptionFormat exceptionFormat : conf.getExceptionFormats().getExceptionFormat() ) { if ( exceptionFormat.getXSLTFile() != null ) { String format = exceptionFormat.getFormat(); String xsltFile = exceptionFormat.getXSLTFile(); URL xsltUrl = metadata.getLocation().resolveToUrl( xsltFile ); exceptionsManager.addOrReplaceXsltFormat( format, xsltUrl, workspace ); } } } }
@Override public RemoteOWS build() { try { URL capas = metadata.getLocation().resolveToUrl( cfg.getCapabilitiesDocumentLocation().getLocation() ); int connTimeout = cfg.getConnectionTimeout() == null ? 5 : cfg.getConnectionTimeout(); int reqTimeout = cfg.getRequestTimeout() == null ? 60 : cfg.getRequestTimeout(); WMSClient client; AuthenticationType type = cfg.getAuthentication() == null ? null : cfg.getAuthentication().getValue(); String user = null; String pass = null; if ( type instanceof HTTPBasicAuthenticationType ) { HTTPBasicAuthenticationType basic = (HTTPBasicAuthenticationType) type; user = basic.getUsername(); pass = basic.getPassword(); } client = new WMSClient( capas, connTimeout, reqTimeout, user, pass ); return new org.deegree.remoteows.wms.RemoteWMS( client, metadata ); } catch ( Exception e ) { throw new ResourceInitException( "Unable to build remote WMS: " + e.getLocalizedMessage(), e ); } }
GMLVersion version = GMLVersion.valueOf( xsltFile.getGmlVersion().toString() ); featureInfoManager.addOrReplaceXsltFormat( t.getFormat(), metadata.getLocation().resolveToUrl( xsltFile.getValue() ), version, workspace ); } else if ( t.getSerializer() != null ) {
static FeatureInfoManager buildFeatureInfoManager( FeatureInfoFormatsType conf, ResourceLocation<?> location, Workspace workspace ) throws ResourceInitException { FeatureInfoManager featureInfoManager = new FeatureInfoManager( true ); try { if ( conf != null ) { for ( GetFeatureInfoFormat t : conf.getGetFeatureInfoFormat() ) { if ( t.getFile() != null ) { featureInfoManager.addOrReplaceFormat( t.getFormat(), location.resolveToFile( t.getFile() ).toString() ); } else { XSLTFile xsltFile = t.getXSLTFile(); GMLVersion version = GMLVersion.valueOf( xsltFile.getGmlVersion().toString() ); featureInfoManager.addOrReplaceXsltFormat( t.getFormat(), location.resolveToUrl( xsltFile.getValue() ), version, workspace ); } } } } catch ( Exception e ) { throw new ResourceInitException( "GetFeatureInfo format handler could not be initialized: " + e.getLocalizedMessage(), e ); } return featureInfoManager; }
List<URL> list = new ArrayList<URL>(); for ( String file : jaxbConfig.getStoredQuery() ) { URL url = metadata.getLocation().resolveToUrl( file ); if ( url == null ) { LOG.warn( "Could not resolve {}.", file );