Package com.ithit.webdav.server
Class DavResponse
java.lang.Object
com.ithit.webdav.server.DavResponse
Represents http response to the WebDAV server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidAdds a response header with the given name and value.abstract ObjectReturns the original response that will be handled by the chosen web container.abstract OutputStreamReturns aOutputStreamsuitable for writing binary data in the response.abstract voidsetCharacterEncoding(String encoding) Sets the character encoding of the response.abstract voidsetContentLength(long length) Sets the content length of the response.abstract voidsetContentType(String type) Sets the MIME content type of the responseabstract voidSets a response header with the given name and value.abstract voidSets 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- Anlonglength 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-Stringencoding.
-
getOutputStream
Returns aOutputStreamsuitable for writing binary data in the response.- Returns:
- a
OutputStreamfor 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.
-