Package com.ithit.webdav.server
Class DavResponse
java.lang.Object
com.ithit.webdav.server.DavResponse
Represents http response to the WebDAV server.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Adds a response header with the given name and value.abstract Object
Returns the original response that will be handled by the chosen web container.abstract OutputStream
Returns aOutputStream
suitable for writing binary data in the response.abstract void
setCharacterEncoding
(String encoding) Sets the character encoding of the response.abstract void
setContentLength
(long length) Sets the content length of the response.abstract void
setContentType
(String type) Sets the MIME content type of the responseabstract void
Sets a response header with the given name and value.abstract void
Sets status code of the response.
-
Constructor Details
-
DavResponse
public DavResponse()
-
-
Method Details
-
addHeader
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
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
- Anlong
length of the response.
-
setContentType
Sets the MIME content type of the response- Parameters:
type
- Content type.
-
setCharacterEncoding
Sets the character encoding of the response.- Parameters:
encoding
-String
encoding.
-
getOutputStream
Returns aOutputStream
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
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
Returns the original response that will be handled by the chosen web container.- Returns:
- Object original response.
-