Class DatasetUrl

java.lang.Object
ucar.nc2.dataset.DatasetUrl

public class DatasetUrl extends Object
Detection of the protocol from a location string. TODO: Review and refactor as needed. Perhaps BiMap\<ServiceType, String>?
Since:
10/20/2015.
  • Field Details

  • Constructor Details

  • Method Details

    • getProtocols

      public static List<String> getProtocols(String url)
      Return the set of leading protocols for a url; may be more than one. Watch out for Windows paths starting with a drive letter => protocol names must all have a length > 1. Watch out for '::' Each captured protocol is saved without trailing ':' Assume: the protocols MUST be terminated by the occurrence of '/'.
      Parameters:
      url - the url whose protocols to return
      Returns:
      list of leading protocols without the trailing :
    • findDatasetUrl

      public static DatasetUrl findDatasetUrl(String orgLocation) throws IOException
      Throws:
      IOException
    • create

      public static DatasetUrl create(@Nullable ServiceType serviceType, String trueurl)
      Create a DatasetUrl, which annotates a url with its service type.
      Parameters:
      serviceType - The serviceType, may be null if not known.
      trueurl - The actual URL
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getServiceType

      public ServiceType getServiceType()
    • getTrueurl

      public String getTrueurl()