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 Details

    • URLnaming

      public URLnaming()
  • Method Details

    • canonicalizeWrite

      public static String canonicalizeWrite(String location)
    • 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 Strng
      relativeUri - relative URI, as a String
      Returns:
      the resolved URI as a String
    • resolveFile

      public static String resolveFile(String baseDir, String filepath)