Codota Logo
DatasetUrl.decodePathExtension
Code IndexAdd Codota to your IDE (free)

How to use
decodePathExtension
method
in
ucar.nc2.dataset.DatasetUrl

Best Java code snippets using ucar.nc2.dataset.DatasetUrl.decodePathExtension (Showing top 2 results out of 315)

  • Common ways to obtain DatasetUrl
private void myMethod () {
DatasetUrl d =
  • Codota IconString orgLocation;DatasetUrl.findDatasetUrl(orgLocation)
  • Codota IconString trueurl;new DatasetUrl(null, trueurl)
  • Smart code suggestions by Codota
}
origin: Unidata/thredds

svctype = decodePathExtension(trueurl); // look at the path extension
if(svctype == null && checkIfNcml(new File(location))) {
 svctype = ServiceType.NCML;
origin: Unidata/thredds

static private boolean checkIfRemoteNcml(String location) throws IOException {
 if (decodePathExtension(location)==ServiceType.NCML) {
  // just because location ends with ncml does not mean it's ncml
  // if the ncml file is being served up via http by a remote server,
  // we should be able to read the first bit of it and see if it even
  // looks like an ncml file.
  try (HTTPMethod method = HTTPFactory.Get(location)) {
   method.setRange(0, NUM_BYTES_TO_DETERMINE_NCML);
   method.setRequestHeader("accept-encoding", "identity");
   int statusCode = method.execute();
   if (statusCode >= 300) {
    if (statusCode == 401) {
     throw new IOException("Unauthorized to open dataset " + location);
    } else if (statusCode == 406) {
     String msg = location + " - this server does not support returning content without any encoding.";
     msg = msg + " Please download the file locally. Return status=" + statusCode;
     throw new IOException(msg);
    } else {
     throw new IOException(location + " is not a valid URL, return status=" + statusCode);
    }
   }
   return checkIfNcml(method.getResponseAsString());
  }
 }
 return false;
}
ucar.nc2.datasetDatasetUrldecodePathExtension

Javadoc

Check path extension; assumes no query or fragment

Popular methods of DatasetUrl

  • <init>
  • findDatasetUrl
  • getProtocols
    Return the set of leading protocols for a url; may be more than one. Watch out for Windows paths sta
  • checkIfCdmr
  • checkIfDap4
  • checkIfDods
  • checkIfNcml
  • checkIfRemoteNcml
  • decodeLeadProtocol
  • disambiguateHttp
    If the URL alone is not sufficient to disambiguate the location, then this method will attempt to do
  • hashCode
  • parseFragment
    Given the fragment part of a url, see if it parses as name=value pairs separated by '&' (same as que
  • hashCode,
  • parseFragment,
  • searchFragment,
  • searchPath,
  • validateprotocol

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • startActivity (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now