Class MethodBase

    • Field Detail

      • dumpContent

        protected boolean dumpContent
      • hasBriefHeader

        protected boolean hasBriefHeader
      • nsIntf

        protected WebdavNsIntf nsIntf
        namespace interface for this request
      • xml

        protected org.bedework.util.xml.XmlEmit xml
    • Constructor Detail

      • MethodBase

        public MethodBase()
    • Method Detail

      • init

        public abstract void init()
        Called at each request
      • doMethod

        public abstract void doMethod​(javax.servlet.http.HttpServletRequest req,
                                      javax.servlet.http.HttpServletResponse resp)
                               throws WebdavException
        Parameters:
        req - http request
        resp - http response
        Throws:
        WebdavException - on fatal error
      • init

        public void init​(WebdavNsIntf nsIntf,
                         boolean dumpContent)
        Called at each request
        Parameters:
        nsIntf - interface
        dumpContent - true to provide debug content dump
      • getNsIntf

        public WebdavNsIntf getNsIntf()
        Get namespace interface
        Returns:
        WebdavNsIntf
      • getResourceUri

        public String getResourceUri​(javax.servlet.http.HttpServletRequest req)
                              throws WebdavException
        Get the decoded and fixed resource URI
        Parameters:
        req - Servlet request object
        Returns:
        String fixed up uri
        Throws:
        WebdavException - on fatal error
      • defaultDepth

        protected int defaultDepth​(int depth,
                                   int def)
      • getStatus

        protected String getStatus​(int status,
                                   String message)
      • addStatus

        protected void addStatus​(int status,
                                 String message)
      • checkServerInfo

        public void checkServerInfo​(javax.servlet.http.HttpServletRequest req,
                                    javax.servlet.http.HttpServletResponse resp)
                             throws WebdavException
        Throws:
        WebdavException
      • parseContent

        protected Document parseContent​(javax.servlet.http.HttpServletRequest req,
                                        javax.servlet.http.HttpServletResponse resp)
                                 throws WebdavException
        Parse the Webdav request body, and return the DOM representation.
        Parameters:
        req - Servlet request object
        resp - Servlet response object for bad status
        Returns:
        Document Parsed body or null for no body
        Throws:
        WebdavException - Some error occurred.
      • parseContent

        protected Document parseContent​(int contentLength,
                                        Reader reader)
                                 throws WebdavException
        Parse a reader and return the DOM representation.
        Parameters:
        contentLength - Content length
        reader - Reader
        Returns:
        Document Parsed body or null for no body
        Throws:
        WebdavException - Some error occurred.
      • getChildrenArray

        protected Element[] getChildrenArray​(Node nd)
      • getOnlyChild

        protected Element getOnlyChild​(Node nd)
      • getElementContent

        protected String getElementContent​(Element el)
      • isEmpty

        protected boolean isEmpty​(Element el)
      • startEmit

        protected void startEmit​(javax.servlet.http.HttpServletResponse resp)
      • addNs

        public void addNs​(String val)
        Add a namespace
        Parameters:
        val - String namespace
        Throws:
        RuntimeException - on fatal error
      • getNsAbbrev

        public String getNsAbbrev​(String ns)
        Get a namespace abbreviation
        Parameters:
        ns - namespace
        Returns:
        String abbrev
      • openTag

        protected void openTag​(QName tag)
      • openTagNoNewline

        protected void openTagNoNewline​(QName tag)
      • closeTag

        protected void closeTag​(QName tag)
      • emptyTag

        public void emptyTag​(QName tag)
        Emit an empty tag
        Parameters:
        tag - qname
        Throws:
        RuntimeException - on fatal error
      • emptyTag

        public void emptyTag​(Node nd)
        Emit an empty tag corresponding to a node
        Parameters:
        nd - xml node
        Throws:
        RuntimeException - on fatal error
      • property

        public void property​(QName tag,
                             String val)
        Emit a property
        Parameters:
        tag - qname
        val - element value
        Throws:
        RuntimeException - on fatal error
      • cdataProperty

        public void cdataProperty​(QName tag,
                                  String attrName,
                                  String attrVal,
                                  String val)
        Emit a property in a cdata
        Parameters:
        tag - qname
        val - element value
        Throws:
        RuntimeException - on fatal error
      • property

        public void property​(QName tag,
                             Reader val)
        Emit a property
        Parameters:
        tag - qname
        val - element value
        Throws:
        RuntimeException - on fatal error
      • propertyTagVal

        public void propertyTagVal​(QName tag,
                                   QName tagVal)
        Emit a property with a qname value
        Parameters:
        tag - qname
        tagVal - qname
        Throws:
        RuntimeException - on fatal error
      • flush

        protected void flush()
      • getLogger

        public org.bedework.util.logging.BwLogger getLogger()
        Specified by:
        getLogger in interface org.bedework.util.logging.Logged