Class DavResponse

java.lang.Object
com.ithit.webdav.server.DavResponse

public abstract class DavResponse extends Object
Represents http response to the WebDAV server.
  • Constructor Details

    • DavResponse

      public DavResponse()
  • Method Details

    • addHeader

      public abstract void addHeader(String name, String value)
      Adds a response header with the given name and value. This method allows response headers to have multiple values.
      Parameters:
      name - Header name.
      value - Header value.
    • setStatus

      public abstract void setStatus(int code, String description)
      Sets status code of the response.
      Parameters:
      code - Status code.
      description - Status description.
    • setContentLength

      public abstract void setContentLength(long length)
      Sets the content length of the response.
      Parameters:
      length - An long length of the response.
    • setContentType

      public abstract void setContentType(String type)
      Sets the MIME content type of the response
      Parameters:
      type - Content type.
    • setCharacterEncoding

      public abstract void setCharacterEncoding(String encoding)
      Sets the character encoding of the response.
      Parameters:
      encoding - String encoding.
    • getOutputStream

      public abstract OutputStream getOutputStream() throws IOException
      Returns a OutputStream suitable for writing binary data in the response.
      Returns:
      a OutputStream for writing binary data.
      Throws:
      IOException - if an input or output exception occurred.
    • setHeader

      public abstract void setHeader(String name, String value)
      Sets a response header with the given name and value. If the header had already been set, the new value overwrites the previous one.
      Parameters:
      name - Header name.
      value - Header value.
    • getOriginalResponse

      public abstract Object getOriginalResponse()
      Returns the original response that will be handled by the chosen web container.
      Returns:
      Object original response.