Package org.apache.jackrabbit.webdav
Class WebdavResponseImpl
- java.lang.Object
-
- org.apache.jackrabbit.webdav.WebdavResponseImpl
-
- All Implemented Interfaces:
javax.servlet.http.HttpServletResponse,javax.servlet.ServletResponse,DavServletResponse,ObservationDavServletResponse,WebdavResponse
public class WebdavResponseImpl extends Object implements WebdavResponse
WebdavResponseImpl implements theWebdavResponseinterface.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.webdav.DavServletResponse
SC_FAILED_DEPENDENCY, SC_INSUFFICIENT_SPACE_ON_RESOURCE, SC_LOCKED, SC_MULTI_STATUS, SC_PROCESSING, SC_UNPROCESSABLE_ENTITY
-
Fields inherited from interface javax.servlet.http.HttpServletResponse
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
-
-
Constructor Summary
Constructors Constructor Description WebdavResponseImpl(javax.servlet.http.HttpServletResponse httpResponse)Create a newWebdavResponseWebdavResponseImpl(javax.servlet.http.HttpServletResponse httpResponse, boolean noCache)Create a newWebdavResponse
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCookie(javax.servlet.http.Cookie cookie)voidaddDateHeader(String s, long l)voidaddHeader(String s, String s1)voidaddIntHeader(String s, int i)booleancontainsHeader(String s)StringencodeRedirectUrl(String s)StringencodeRedirectURL(String s)StringencodeUrl(String s)StringencodeURL(String s)voidflushBuffer()intgetBufferSize()StringgetCharacterEncoding()StringgetContentType()StringgetHeader(String name)Collection<String>getHeaderNames()Collection<String>getHeaders(String name)LocalegetLocale()javax.servlet.ServletOutputStreamgetOutputStream()intgetStatus()Supplier<Map<String,String>>getTrailerFields()PrintWritergetWriter()booleanisCommitted()voidreset()voidresetBuffer()voidsendError(int i)voidsendError(int i, String s)voidsendError(DavException exception)If the specifid exception provides an error condition an Xml response body is sent providing more detailed information about the error.voidsendMultiStatus(MultiStatus multistatus)Send the multistatus response to the client.voidsendMultiStatus(MultiStatus multistatus, List<String> acceptableContentCodings)Send the multistatus response to the client.voidsendPollResponse(EventDiscovery eventDiscovery)Send the response to a successful POLL request.voidsendRedirect(String s)voidsendRefreshLockResponse(ActiveLock[] locks)Send response body for a lock request that was intended to refresh one or several locks.voidsendSubscriptionResponse(Subscription subscription)Send the response to a successful SUBSCRIBE request.voidsendXmlResponse(XmlSerializable serializable, int status)Generic method to return an Xml response body.voidsendXmlResponse(XmlSerializable serializable, int status, List<String> acceptableContentCodings)Generic method to return an Xml response body.voidsetBufferSize(int i)voidsetCharacterEncoding(String charset)voidsetContentLength(int i)voidsetContentLengthLong(long len)voidsetContentType(String s)voidsetDateHeader(String s, long l)voidsetHeader(String s, String s1)voidsetIntHeader(String s, int i)voidsetLocale(Locale locale)voidsetStatus(int i)voidsetStatus(int i, String s)voidsetTrailerFields(Supplier<Map<String,String>> supplier)
-
-
-
Constructor Detail
-
WebdavResponseImpl
public WebdavResponseImpl(javax.servlet.http.HttpServletResponse httpResponse)
Create a newWebdavResponse- Parameters:
httpResponse-
-
WebdavResponseImpl
public WebdavResponseImpl(javax.servlet.http.HttpServletResponse httpResponse, boolean noCache)Create a newWebdavResponse- Parameters:
httpResponse-noCache-
-
-
Method Detail
-
sendError
public void sendError(DavException exception) throws IOException
If the specifid exception provides an error condition an Xml response body is sent providing more detailed information about the error. Otherwise only the error code and status phrase is sent back.- Specified by:
sendErrorin interfaceDavServletResponse- Parameters:
exception-- Throws:
IOException- See Also:
DavServletResponse.sendError(org.apache.jackrabbit.webdav.DavException),sendError(int, String),sendXmlResponse(XmlSerializable, int)
-
sendMultiStatus
public void sendMultiStatus(MultiStatus multistatus) throws IOException
Description copied from interface:DavServletResponseSend the multistatus response to the client. A multistatus response is returned in response to a successful PROPFIND and PROPPATCH request. In addition multistatus response is required response in case a COPY, MOVE, DELETE, LOCK or PROPPATCH request fails.- Specified by:
sendMultiStatusin interfaceDavServletResponse- Throws:
IOException- See Also:
DavServletResponse.SC_MULTI_STATUS
-
sendMultiStatus
public void sendMultiStatus(MultiStatus multistatus, List<String> acceptableContentCodings) throws IOException
Description copied from interface:DavServletResponseSend the multistatus response to the client. A multistatus response is returned in response to a successful PROPFIND and PROPPATCH request. In addition multistatus response is required response in case a COPY, MOVE, DELETE, LOCK or PROPPATCH request fails.- Specified by:
sendMultiStatusin interfaceDavServletResponseacceptableContentCodings- content codings accepted by the client- Throws:
IOException- See Also:
DavServletResponse.SC_MULTI_STATUS
-
sendRefreshLockResponse
public void sendRefreshLockResponse(ActiveLock[] locks) throws IOException
Send response body for a lock request that was intended to refresh one or several locks.- Specified by:
sendRefreshLockResponsein interfaceDavServletResponse- Parameters:
locks-- Throws:
IOException- See Also:
DavServletResponse.sendRefreshLockResponse(org.apache.jackrabbit.webdav.lock.ActiveLock[])
-
sendXmlResponse
public void sendXmlResponse(XmlSerializable serializable, int status) throws IOException
Description copied from interface:DavServletResponseGeneric method to return an Xml response body.- Specified by:
sendXmlResponsein interfaceDavServletResponse- Parameters:
serializable- object that can be converted to the root Xml element of the document to be sent as response body.status- Status code to be used withHttpServletResponse.setStatus(int).- Throws:
IOException
-
sendXmlResponse
public void sendXmlResponse(XmlSerializable serializable, int status, List<String> acceptableContentCodings) throws IOException
Description copied from interface:DavServletResponseGeneric method to return an Xml response body.- Specified by:
sendXmlResponsein interfaceDavServletResponse- Parameters:
serializable- object that can be converted to the root Xml element of the document to be sent as response body.status- Status code to be used withHttpServletResponse.setStatus(int).acceptableContentCodings- content codings accepted by the client- Throws:
IOException
-
sendSubscriptionResponse
public void sendSubscriptionResponse(Subscription subscription) throws IOException
Description copied from interface:ObservationDavServletResponseSend the response to a successful SUBSCRIBE request.- Specified by:
sendSubscriptionResponsein interfaceObservationDavServletResponse- Parameters:
subscription-- Throws:
IOException- See Also:
ObservationDavServletResponse.sendSubscriptionResponse(org.apache.jackrabbit.webdav.observation.Subscription)
-
sendPollResponse
public void sendPollResponse(EventDiscovery eventDiscovery) throws IOException
Description copied from interface:ObservationDavServletResponseSend the response to a successful POLL request.- Specified by:
sendPollResponsein interfaceObservationDavServletResponse- Parameters:
eventDiscovery-- Throws:
IOException- See Also:
ObservationDavServletResponse.sendPollResponse(org.apache.jackrabbit.webdav.observation.EventDiscovery)
-
addCookie
public void addCookie(javax.servlet.http.Cookie cookie)
- Specified by:
addCookiein interfacejavax.servlet.http.HttpServletResponse
-
containsHeader
public boolean containsHeader(String s)
- Specified by:
containsHeaderin interfacejavax.servlet.http.HttpServletResponse
-
encodeURL
public String encodeURL(String s)
- Specified by:
encodeURLin interfacejavax.servlet.http.HttpServletResponse
-
encodeRedirectURL
public String encodeRedirectURL(String s)
- Specified by:
encodeRedirectURLin interfacejavax.servlet.http.HttpServletResponse
-
encodeUrl
public String encodeUrl(String s)
- Specified by:
encodeUrlin interfacejavax.servlet.http.HttpServletResponse
-
encodeRedirectUrl
public String encodeRedirectUrl(String s)
- Specified by:
encodeRedirectUrlin interfacejavax.servlet.http.HttpServletResponse
-
sendError
public void sendError(int i, String s) throws IOException- Specified by:
sendErrorin interfacejavax.servlet.http.HttpServletResponse- Throws:
IOException
-
sendError
public void sendError(int i) throws IOException- Specified by:
sendErrorin interfacejavax.servlet.http.HttpServletResponse- Throws:
IOException
-
sendRedirect
public void sendRedirect(String s) throws IOException
- Specified by:
sendRedirectin interfacejavax.servlet.http.HttpServletResponse- Throws:
IOException
-
setDateHeader
public void setDateHeader(String s, long l)
- Specified by:
setDateHeaderin interfacejavax.servlet.http.HttpServletResponse
-
addDateHeader
public void addDateHeader(String s, long l)
- Specified by:
addDateHeaderin interfacejavax.servlet.http.HttpServletResponse
-
setHeader
public void setHeader(String s, String s1)
- Specified by:
setHeaderin interfacejavax.servlet.http.HttpServletResponse
-
addHeader
public void addHeader(String s, String s1)
- Specified by:
addHeaderin interfacejavax.servlet.http.HttpServletResponse
-
setIntHeader
public void setIntHeader(String s, int i)
- Specified by:
setIntHeaderin interfacejavax.servlet.http.HttpServletResponse
-
addIntHeader
public void addIntHeader(String s, int i)
- Specified by:
addIntHeaderin interfacejavax.servlet.http.HttpServletResponse
-
setStatus
public void setStatus(int i)
- Specified by:
setStatusin interfacejavax.servlet.http.HttpServletResponse
-
setStatus
public void setStatus(int i, String s)- Specified by:
setStatusin interfacejavax.servlet.http.HttpServletResponse
-
getCharacterEncoding
public String getCharacterEncoding()
- Specified by:
getCharacterEncodingin interfacejavax.servlet.ServletResponse
-
getOutputStream
public javax.servlet.ServletOutputStream getOutputStream() throws IOException- Specified by:
getOutputStreamin interfacejavax.servlet.ServletResponse- Throws:
IOException
-
getWriter
public PrintWriter getWriter() throws IOException
- Specified by:
getWriterin interfacejavax.servlet.ServletResponse- Throws:
IOException
-
setContentLength
public void setContentLength(int i)
- Specified by:
setContentLengthin interfacejavax.servlet.ServletResponse
-
setContentType
public void setContentType(String s)
- Specified by:
setContentTypein interfacejavax.servlet.ServletResponse
-
setBufferSize
public void setBufferSize(int i)
- Specified by:
setBufferSizein interfacejavax.servlet.ServletResponse
-
getBufferSize
public int getBufferSize()
- Specified by:
getBufferSizein interfacejavax.servlet.ServletResponse
-
flushBuffer
public void flushBuffer() throws IOException- Specified by:
flushBufferin interfacejavax.servlet.ServletResponse- Throws:
IOException
-
resetBuffer
public void resetBuffer()
- Specified by:
resetBufferin interfacejavax.servlet.ServletResponse
-
isCommitted
public boolean isCommitted()
- Specified by:
isCommittedin interfacejavax.servlet.ServletResponse
-
reset
public void reset()
- Specified by:
resetin interfacejavax.servlet.ServletResponse
-
setLocale
public void setLocale(Locale locale)
- Specified by:
setLocalein interfacejavax.servlet.ServletResponse
-
getLocale
public Locale getLocale()
- Specified by:
getLocalein interfacejavax.servlet.ServletResponse
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfacejavax.servlet.ServletResponse
-
setCharacterEncoding
public void setCharacterEncoding(String charset)
- Specified by:
setCharacterEncodingin interfacejavax.servlet.ServletResponse
-
getStatus
public int getStatus()
- Specified by:
getStatusin interfacejavax.servlet.http.HttpServletResponse
-
getHeader
public String getHeader(String name)
- Specified by:
getHeaderin interfacejavax.servlet.http.HttpServletResponse
-
getHeaders
public Collection<String> getHeaders(String name)
- Specified by:
getHeadersin interfacejavax.servlet.http.HttpServletResponse
-
getHeaderNames
public Collection<String> getHeaderNames()
- Specified by:
getHeaderNamesin interfacejavax.servlet.http.HttpServletResponse
-
setContentLengthLong
public void setContentLengthLong(long len)
- Specified by:
setContentLengthLongin interfacejavax.servlet.ServletResponse
-
setTrailerFields
public void setTrailerFields(Supplier<Map<String,String>> supplier)
- Specified by:
setTrailerFieldsin interfaceWebdavResponse
-
getTrailerFields
public Supplier<Map<String,String>> getTrailerFields()
- Specified by:
getTrailerFieldsin interfaceWebdavResponse
-
-