Class GetInfoHandler


  • public class GetInfoHandler
    extends Object
    Default handler for OPeNDAP info requests. This class is used by AbstractServlet. This code exists as a separate class in order to alleviate code bloat in the AbstractServlet class. As such, it contains virtually no state, just behaviors.
    • Constructor Detail

      • GetInfoHandler

        public GetInfoHandler()
    • Method Detail

      • sendINFO

        public void sendINFO​(PrintWriter pw,
                             GuardedDataset gds,
                             ReqState rs)
                      throws opendap.dap.DAP2Exception,
                             opendap.dap.parsers.ParseException
        ************************************************************************ Default handler for OPeNDAP info requests. Returns an html document describing the contents of the servers datasets.

        The "INFOcache" <init-param> element in the web.xml file specifies the designated location for:

        • ".info" response override files.
        • Server specific HTML* files.
        • Dataset specific HTML* files .

        The server specific HTML* files must be named #servlet#.html where #servlet# is the name of the servlet that is running as the OPeNDAP server in question. This name is determined at run time by using the class called Class ( this.getClass().getName() ).

        In the C++ code the analogy is the per-cgi file names.

        The dataset specific HTML* files are located by catenating `.html' to #name#, where #name# is the name of the dataset. If the filename part of #name# is of the form [A-Za-z]+[0-9]*.* then this function also looks for a file whose name is [A-Za-z].html For example, if #name# is .../data/fnoc1.nc this function first looks for .../data/fnoc1.nc.html. However, if that does not exist it will look for .../data/fnoc.html. This allows one `per-dataset' file to be used for a collection of files with the same root name.

        NB: An HTML* file contains HTML without the , or tags (my own notation).

        Look for the user supplied Server- and dataset-specific HTML* documents.

        Parameters:
        pw - The PrintStream to which the output should be written.
        gds - The thread safe dataset.
        rs - The ReqState object for theis client request.
        Throws:
        opendap.dap.DAP2Exception
        opendap.dap.parsers.ParseException
        See Also:
        GuardedDataset, ReqState
      • loadOverrideDoc

        public String loadOverrideDoc​(String infoDir,
                                      String dataSet)
                               throws opendap.dap.DAP2Exception
        ************************************************************************ Checks the info directory for user supplied override documents for the passed dataset name. If there are overridedocuments present then the contents are read and returned to the caller as a string.
        Parameters:
        dataSet - The name of the dataset.
        Throws:
        opendap.dap.DAP2Exception