Package ucar.nc2.util
Class URLnaming
- java.lang.Object
-
- ucar.nc2.util.URLnaming
-
public class URLnaming extends Object
Networking utilities. TODO move to util.net
-
-
Constructor Summary
Constructors Constructor Description URLnaming()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcanonicalizeWrite(String location)static Stringresolve(String baseUri, String relativeUri)This augments URI.resolve(), by also dealing with file: URIs.static StringresolveFile(String baseDir, String filepath)
-
-
-
Method Detail
-
resolve
public static String resolve(String baseUri, String relativeUri)
This augments URI.resolve(), by also dealing with file: URIs. If baseURi is not a file: scheme, then URI.resolve is called. Otherwise the last "/" is found in the base, and the ref is appended to it.For file: baseURLS: only relative URLS not starting with / are supported. This is apparently different from the behavior of URI.resolve(), so may be trouble, but it allows NcML absolute location to be specified without the file: prefix.
Example :base: file://my/guide/collections/designfaq.ncml ref: sub/my.nc resolved: file://my/guide/collections/sub/my.nc
- Parameters:
baseUri- base URI as a StrngrelativeUri- relative URI, as a String- Returns:
- the resolved URI as a String
-
-