/** * @return Xlink reference as a URI, resolved */ public URI getURI() { if (uri != null) return uri; // may be reletive try { return getParentCatalog().resolveUri(href); } catch (java.net.URISyntaxException e) { errMessage = "URISyntaxException on url " + href + " = " + e.getMessage(); return null; } }
/** * @return Xlink reference as a URI, resolved */ public URI getURI() { if (uri != null) return uri; // may be reletive try { return getParentCatalog().resolveUri(href); } catch (java.net.URISyntaxException e) { synchronized (this) { errMessage = "URISyntaxException on url " + href + " = " + e.getMessage(); } return null; } }
/** * @return Xlink reference as a URI, resolved */ public URI getURI() { if (uri != null) return uri; // may be relative try { return getParentCatalog().resolveUri(href); } catch (java.net.URISyntaxException e) { synchronized (this) { errMessage = "URISyntaxException on url " + href + " = " + e.getMessage(); } return null; } }
/** * resolve reletive URLS against the catalog URL. * * @param ds use ds parent catalog, if it exists * @param href URL to resolve * @return resolved URL */ static public String resolve(InvDataset ds, String href) { InvCatalog cat = ds.getParentCatalog(); if (cat != null) { try { java.net.URI uri = cat.resolveUri(href); href = uri.toString(); } catch (java.net.URISyntaxException e) { logger.warn("InvDatasetImpl.writeHtml: error parsing URL= " + href); } } return href; }
/** * resolve reletive URLS against the catalog URL. * * @param ds use ds parent catalog, if it exists * @param href URL to resolve * @return resolved URL */ static public String resolve(InvDataset ds, String href) { InvCatalog cat = ds.getParentCatalog(); if (cat != null) { try { java.net.URI uri = cat.resolveUri(href); href = uri.toString(); } catch (java.net.URISyntaxException e) { System.err.println("InvDatasetImpl.writeHtml: error parsing URL= " + href); } } return href; }
/** * resolve reletive URLS against the catalog URL. * * @param ds use ds parent catalog, if it exists * @param href URL to resolve * @return resolved URL */ static public String resolve(InvDataset ds, String href) { InvCatalog cat = ds.getParentCatalog(); if (cat != null) { try { java.net.URI uri = cat.resolveUri(href); href = uri.toString(); } catch (java.net.URISyntaxException e) { logger.warn("InvDatasetImpl.writeHtml: error parsing URL= " + href); } } return href; }
/** * Finish getting the metadata if necessary. * If this is an XLink, this will trigger a read of the href the first time called. */ public void finish() { if (init) return; init = true; if (xlinkHref == null) return; xlinkHref = xlinkHref.trim(); try { this.xlinkUri = dataset.getParentCatalog().resolveUri(xlinkHref); } catch (java.net.URISyntaxException e) { log.append(" ** Error: Bad URL in metadata href = ").append(xlinkHref).append("\n"); return; } // open and read the referenced catalog XML try { if (converter == null) { log.append(" **InvMetadata on = (").append(this).append("): has no converter\n"); return; } contentObject = converter.readMetadataContentFromURL(dataset, xlinkUri); if (isThreddsMetadata) tm = (ThreddsMetadata) contentObject; } catch (java.io.IOException e) { log.append(" **InvMetadata on = (").append(xlinkUri).append("): Exception (").append(e.getMessage()).append(")\n"); // e.printStackTrace(); } }
/** * Finish getting the metadata if necessary. * If this is an XLink, this will trigger a read of the href the first time called. */ public void finish() { if (init) return; init = true; if (xlinkHref == null) return; xlinkHref = xlinkHref.trim(); try { this.xlinkUri = dataset.getParentCatalog().resolveUri(xlinkHref); } catch (java.net.URISyntaxException e) { log.append(" ** Error: Bad URL in metadata href = ").append(xlinkHref).append("\n"); return; } // open and read the referenced catalog XML try { if (converter == null) { log.append(" **InvMetadata on = (").append(this).append("): has no converter\n"); return; } contentObject = converter.readMetadataContentFromURL(dataset, xlinkUri); if (isThreddsMetadata) tm = (ThreddsMetadata) contentObject; } catch (java.io.IOException e) { log.append(" **InvMetadata on = (").append(xlinkUri).append("): Exception (").append(e.getMessage()).append(")\n"); // e.printStackTrace(); } }
/** * Finish getting the metadata if necessary. * If this is an XLink, this will trigger a read of the href the first time called. */ public void finish() { if (init) return; init = true; if (xlinkHref == null) return; xlinkHref = xlinkHref.trim(); try { this.xlinkUri = dataset.getParentCatalog().resolveUri(xlinkHref); } catch (java.net.URISyntaxException e) { log.append(" ** Error: Bad URL in metadata href = ").append(xlinkHref).append("\n"); return; } // open and read the referenced catalog XML try { if (converter == null) { log.append(" **InvMetadata on = (").append(this).append("): has no converter\n"); return; } contentObject = converter.readMetadataContentFromURL(dataset, xlinkUri); if (isThreddsMetadata) tm = (ThreddsMetadata) contentObject; } catch (java.io.IOException e) { log.append(" **InvMetadata on = (").append(xlinkUri).append("): Exception (").append(e.getMessage()).append(")\n"); // e.printStackTrace(); } }
/** * Construct the standard THREDDS access URI for this dataset access method, * resolve if the URI is relative. * * @return the standard fully resolved THREDDS access URI for this dataset access method, or null if error. */ public URI getStandardUri() { try { InvCatalog cat = dataset.getParentCatalog(); if (cat == null) return new URI(getUnresolvedUrlName()); return cat.resolveUri(getUnresolvedUrlName()); } catch (java.net.URISyntaxException e) { logger.warn("Error parsing URL= " + getUnresolvedUrlName()); return null; } }
/** * Construct the standard THREDDS access URI for this dataset access method, * resolve if the URI is relative. * * @return the standard fully resolved THREDDS access URI for this dataset access method, or null if error. */ public URI getStandardUri() { try { InvCatalog cat = dataset.getParentCatalog(); if (cat == null) return new URI(getUnresolvedUrlName()); return cat.resolveUri(getUnresolvedUrlName()); } catch (java.net.URISyntaxException e) { System.err.println("Error parsing URL= " + getUnresolvedUrlName()); return null; } }
/** * Construct the standard THREDDS access URI for this dataset access method, * resolve if the URI is relative. * * @return the standard fully resolved THREDDS access URI for this dataset access method, or null if error. */ public URI getStandardUri() { try { InvCatalog cat = dataset.getParentCatalog(); if (cat == null) return new URI(getUnresolvedUrlName()); return cat.resolveUri(getUnresolvedUrlName()); } catch (java.net.URISyntaxException e) { logger.warn("Error parsing URL= " + getUnresolvedUrlName()); return null; } }
protected InvDocumentation readDocumentation(InvCatalog cat, Element s) { String href = s.getAttributeValue("href", xlinkNS); String title = s.getAttributeValue("title", xlinkNS); String type = s.getAttributeValue("type"); // not XLink type String content = s.getTextNormalize(); URI uri = null; if (href != null) { try { uri = cat.resolveUri(href); } catch (Exception e) { factory.appendErr(" ** Invalid documentation href = " + href + " " + e.getMessage() + "\n"); } } InvDocumentation doc = new InvDocumentation(href, uri, title, type, content); // LOOK XHTML ?? !! if (InvCatalogFactory.debugXML) System.out.println(" Documentation added: " + doc); return doc; }
protected InvDocumentation readDocumentation(InvCatalog cat, Element s) { String href = s.getAttributeValue("href", xlinkNS); String title = s.getAttributeValue("title", xlinkNS); String type = s.getAttributeValue("type"); // not XLink type String content = s.getTextNormalize(); URI uri = null; if (href != null) { try { uri = cat.resolveUri(href); } catch (Exception e) { factory.appendErr(" ** Invalid documentation href = " + href + " " + e.getMessage() + "\n"); } } InvDocumentation doc = new InvDocumentation(href, uri, title, type, content); // LOOK XHTML ?? !! if (InvCatalogFactory.debugXML) System.out.println(" Documentation added: " + doc); return doc; }
protected InvDocumentation readDocumentation( InvCatalog cat, Element s) { String href = s.getAttributeValue("href", xlinkNS); String title = s.getAttributeValue("title", xlinkNS); String type = s.getAttributeValue("type"); // not XLink type String content = s.getTextNormalize(); URI uri = null; if (href != null) { try { uri = cat.resolveUri(href); } catch (Exception e) { factory.appendErr(" ** Invalid documentation href = "+href+" "+e.getMessage()+"\n"); } } InvDocumentation doc = new InvDocumentation( href, uri, title, type, content); // LOOK XHTML ?? !! if (InvCatalogFactory.debugXML) System.out.println (" Documentation added: "+ doc); return doc; }
java.net.URI uri = getParentCatalog().resolveUri(href); hrefResolved = uri.toString();
java.net.URI uri = getParentCatalog().resolveUri(href); hrefResolved = uri.toString();
java.net.URI uri = getParentCatalog().resolveUri(href); hrefResolved = uri.toString();
if (vocabHref != null) { try { vocabUri = cat.resolveUri(vocabHref); } catch (Exception e) { factory.appendErr(" ** Invalid Variables vocabulary URI = " + vocabHref + " " + e.getMessage() + "\n"); mapHref = map.getAttributeValue("href", xlinkNS); try { mapUri = cat.resolveUri(mapHref); } catch (Exception e) { factory.appendErr(" ** Invalid Variables map URI = " + mapHref + " " + e.getMessage() + "\n");
if (vocabHref != null) { try { vocabUri = cat.resolveUri(vocabHref); } catch (Exception e) { factory.appendErr(" ** Invalid Variables vocabulary URI = "+vocabHref+" "+e.getMessage()+"\n"); mapHref = map.getAttributeValue("href", xlinkNS); try { mapUri = cat.resolveUri(mapHref); } catch (Exception e) { factory.appendErr(" ** Invalid Variables map URI = "+mapHref+" "+e.getMessage()+"\n");