Package dap4.dap4lib

Class HttpDSP

  • All Implemented Interfaces:
    dap4.core.data.DSP

    public class HttpDSP
    extends D4DSP
    Make a request to a server and convert the reply to a DapDataset from the returned bytes.
    • Constructor Detail

      • HttpDSP

        public HttpDSP()
    • Method Detail

      • dspMatch

        public boolean dspMatch​(String url,
                                dap4.core.util.DapContext context)
        A path is a DAP4 path if at least one of the following is true. 1. it has "dap4:" as its leading protocol 2. it has #protocol=dap4 in its fragment
        Parameters:
        url -
        context - Any parameters that may help to decide.
        Returns:
        true if this url appears to be processible by this DSP
      • open

        public HttpDSP open​(String url)
                     throws dap4.core.util.DapException
        Description copied from class: AbstractDSP
        "open" a reference to a data source and return the DSP wrapper.
        Specified by:
        open in interface dap4.core.data.DSP
        Specified by:
        open in class AbstractDSP
        Parameters:
        url - - Object that defines the data source
        Returns:
        = wrapping dsp
        Throws:
        dap4.core.util.DapException
      • close

        public void close()
        Specified by:
        close in interface dap4.core.data.DSP
        Specified by:
        close in class AbstractDSP
      • build

        protected void build()
                      throws dap4.core.util.DapException
        Open a connection and make a request for the (possibly constrained) DMR.
        Throws:
        dap4.core.util.DapException
      • callServer

        protected InputStream callServer​(String methodurl)
                                  throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • getCapabilities

        public String getCapabilities​(String url)
                               throws IOException
        Provide a method for getting the capabilities document.
        Parameters:
        url - for accessing the document
        Throws:
        dap4.core.util.DapException
        IOException
      • buildURL

        protected static String buildURL​(String baseurl,
                                         String suffix,
                                         dap4.core.dmr.DapDataset template,
                                         String ce)
      • parseURL

        protected void parseURL​(String url)
                         throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException