Class WebDavUtil


  • public final class WebDavUtil
    extends java.lang.Object
    Utility methods needed to implement a WebDAV servlet.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatDate​(java.lang.String formatString, java.util.Date date)  
      static java.util.Map<java.lang.String,​java.lang.Object> getCredentialsFromRequest​(javax.servlet.http.HttpServletRequest request)
      Returns a Map containing user credentials found in the request.
      static org.w3c.dom.Document getDocumentFromRequest​(javax.servlet.http.HttpServletRequest request)  
      static java.lang.String getRFC1123DateFormat()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Method Detail

      • formatDate

        public static java.lang.String formatDate​(java.lang.String formatString,
                                                  java.util.Date date)
      • getDocumentFromRequest

        public static org.w3c.dom.Document getDocumentFromRequest​(javax.servlet.http.HttpServletRequest request)
                                                           throws java.io.IOException,
                                                                  org.xml.sax.SAXException,
                                                                  javax.xml.parsers.ParserConfigurationException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.parsers.ParserConfigurationException
      • getCredentialsFromRequest

        public static java.util.Map<java.lang.String,​java.lang.Object> getCredentialsFromRequest​(javax.servlet.http.HttpServletRequest request)
        Returns a Map containing user credentials found in the request. Returns null if no user credentials were found. The returned Map is intended to be used as parameters for the userLogin service.

        The method checks for the request parameters USERNAME and PASSWORD. If those aren't found, then the request is checked for the HTTP Authorization header. Currently, only Basic authorization is supported.

        Parameters:
        request - The WebDAV request
        Returns:
        A Map containing login.username and login.password elements.
      • getRFC1123DateFormat

        public static java.lang.String getRFC1123DateFormat()