Package com.jalios.jcms.webdav.cat
Class CatWebdavContext
- java.lang.Object
-
- com.jalios.jcms.webdav.WebdavContext
-
- com.jalios.jcms.webdav.cat.CatWebdavContext
-
public class CatWebdavContext extends WebdavContext
A JCMS Representation of a Webdav Context using Category for folders and FileDocument for files
Authentification use BASIC authentification and store result in a cookie.- Since:
- jcms-5.5.0
- Author:
- Jean-Philippe Encausse
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
cachedDestinationHeader
protected java.lang.String
cachedPathHeader
protected JcmsContext
jcmsContext
protected Member
loggedMember
protected static boolean
webdavIpNoPattern
protected static org.apache.oro.text.regex.Pattern
webdavIpPattern
-
Fields inherited from class com.jalios.jcms.webdav.WebdavContext
conf, EMPTY_STRING, hasError, httpDate, httpDateUS, INFINITY, inputStreamContent, isoDate, lang, locale, mapStatusCodes, NAMESPACE, NAMESPACE_MS, originalPathHeader, propAllSet, propFileSet, propMSWebFolderSet, propRFC2518Set, propSubSet, req, res, SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_FORBIDDEN, SC_INSUFFICIENT_SPACE_ON_RESOURCE, SC_INTERNAL_SERVER_ERROR, SC_LOCKED, SC_METHOD_FAILURE, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTI_STATUS, SC_NO_CONTENT, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PRECONDITION_FAILED, SC_REQUEST_TOO_LONG, SC_SERVICE_UNAVAILABLE, SC_UNAUTHORIZED, SC_UNPROCESSABLE_ENTITY, SC_UNSUPPORTED_MEDIA_TYPE, servletURI, setOkStatusCodes, statusCode, statusElm, statusMsg, statusPath
-
-
Constructor Summary
Constructors Constructor Description CatWebdavContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authenticate()
This method have to do all authentication stuff with any behaviorjava.lang.String
getDestinationHeader()
Overrides WebdavContext methods to decode jcmsIds in the path.JcmsContext
getJcmsContext()
Member
getLoggedMember()
java.lang.String
getPathHeader()
Overrides WebdavContext methods to decode jcmsIds in the path.WebdavFileSystem
getWebdavFileSystem()
void
init(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, javax.servlet.ServletConfig conf)
This method will initialize the WebdavContext with given HttpServletRequest, HttpServletResponse, and ServletConfig.boolean
initAfterAuthentication()
This method will initialize the WebdavContext.boolean
isValideIP()
static boolean
requestAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Check if a member has already been logged and otherwise request the WebDAV HTTP authentcation Basic/Digeststatic void
updateProperties()
-
Methods inherited from class com.jalios.jcms.webdav.WebdavContext
addHeader, addStatusCodeMap, addStatusCodeSet, appendStatus, appendStatus, appendStatus, appendStatus, decodePath, encodePath, escapeWebdavChars, getDepthHeader, getHttpDate, getHttpDate, getIfHeader, getIfRangeHeader, getInitParam, getInitParameterNames, getInputStreamContent, getISO8601Date, getLockTokenHeader, getLockTokenValue, getOriginalPathHeader, getOverwriteHeader, getRangeHeader, getRealPath, getServletURI, getStatusText, getTimeoutHeader, hasErrors, isError, sendError, sendError, sendFile, sendHtml, sendMultiStatus, sendMultiStatus, sendMultiStatus, sendSingleStatus, sendSingleStatus, sendStatus, service, setHeader, writeHtmlFolder, writeLock, writeLocks, writeProperties, writeProperties_FindAllProp, writeProperties_FindByProperty, writeProperties_FindPropertyNames, writePropPatch, writeResponse, writeResponseProperties, writeStatus
-
-
-
-
Field Detail
-
loggedMember
protected Member loggedMember
-
jcmsContext
protected JcmsContext jcmsContext
-
webdavIpNoPattern
protected static boolean webdavIpNoPattern
-
webdavIpPattern
protected static org.apache.oro.text.regex.Pattern webdavIpPattern
-
cachedDestinationHeader
protected java.lang.String cachedDestinationHeader
-
cachedPathHeader
protected java.lang.String cachedPathHeader
-
-
Method Detail
-
getWebdavFileSystem
public WebdavFileSystem getWebdavFileSystem()
- Specified by:
getWebdavFileSystem
in classWebdavContext
- Returns:
- WebdavFileSystem the Webdav FileSystem from the context or any other ways.
- See Also:
WebdavContext.getWebdavFileSystem()
-
init
public void init(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, javax.servlet.ServletConfig conf)
Description copied from class:WebdavContext
This method will initialize the WebdavContext with given HttpServletRequest, HttpServletResponse, and ServletConfig.- Overrides:
init
in classWebdavContext
- Parameters:
req
- the HttpServletRequestres
- the HttpServletResponseconf
- the ServletConfig- See Also:
WebdavContext.init(HttpServletRequest, HttpServletResponse, ServletConfig)
-
initAfterAuthentication
public boolean initAfterAuthentication()
Description copied from class:WebdavContext
This method will initialize the WebdavContext.- Overrides:
initAfterAuthentication
in classWebdavContext
- Returns:
- true
- See Also:
WebdavContext.initAfterAuthentication()
-
authenticate
public boolean authenticate()
Description copied from class:WebdavContext
This method have to do all authentication stuff with any behavior- Specified by:
authenticate
in classWebdavContext
- Returns:
- true if authentication has been done
- See Also:
WebdavContext.authenticate()
-
isValideIP
public boolean isValideIP()
-
requestAuthentication
public static boolean requestAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Check if a member has already been logged and otherwise request the WebDAV HTTP authentcation Basic/Digest- Parameters:
request
- the HttpServletRequest for which the authentication should be checkedresponse
- the HttpServletResponse in which authentication should be requested if needed- Returns:
- true if the HTTP authentication was requested, false if nothing was performed
-
updateProperties
public static void updateProperties()
-
getDestinationHeader
public java.lang.String getDestinationHeader()
Overrides WebdavContext methods to decode jcmsIds in the path. The computation is cached for the request duration.- Overrides:
getDestinationHeader
in classWebdavContext
- Returns:
- String the decoded path
-
getPathHeader
public java.lang.String getPathHeader()
Overrides WebdavContext methods to decode jcmsIds in the path. The computation is cached for the request duration.- Overrides:
getPathHeader
in classWebdavContext
- Returns:
- String the decoded path
-
getLoggedMember
public Member getLoggedMember()
- Returns:
- Member the authentifiend LoggedMember
-
getJcmsContext
public JcmsContext getJcmsContext()
- Returns:
- JcmsContext the JcmsContext
-
-