Class WmsUtils


  • public class WmsUtils
    extends Object

    Collection of static utility methods that are useful in the WMS application.

    Through the taglib definition /WEB-INF/taglib/wmsUtils.tld, some of these functions are also available as JSP2.0 functions. For example:

    <%@taglib uri="/WEB-INF/taglib/wmsUtils" prefix="utils"%>
    Author:
    Jon Blower, Guy Griffiths
    • Field Detail

      • SUPPORTED_VERSIONS

        public static final Set<String> SUPPORTED_VERSIONS
        The versions of the WMS standard that this server supports
    • Method Detail

      • createDirectory

        public static void createDirectory​(File dir)
                                    throws Exception
        Creates a directory, throwing an Exception if it could not be created and it does not already exist.
        Throws:
        Exception
      • isOpendapLocation

        public static boolean isOpendapLocation​(String location)
        Returns:
        true if the given location represents an OPeNDAP dataset. This method simply checks to see if the location string starts with "http://", "https://" or "dods://".
      • isNcmlAggregation

        public static boolean isNcmlAggregation​(String location)
        Returns:
        true if the given location represents an NcML aggregation. dataset. This method simply checks to see if the location string ends with ".xml" or ".ncml", following the same procedure as the Java NetCDF library.
      • proxyRequest

        public static void proxyRequest​(String url,
                                        javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response)
        Forwards the request to a third party. In this case this server is acting as a proxy.
        Parameters:
        url - The URL to the third party server (e.g. "http://myhost.com/ncWMS/wms")
        request - Http request object. All query string parameters (except "&url=") will be copied from this request object to the request to the third party server.
        response - Http response object
      • getTimeAxisUnits

        public static String getTimeAxisUnits​(org.joda.time.Chronology chronology)

        Returns the string to be used to display units for the TIME dimension in Capabilities documents. For standard (ISO) chronologies, this will return "ISO8601". Some other chronologies (Julian, 360 day, no leap years, all leap years) will an appropriate string. For other chronologies this will return "unknown".