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.StringcachedDestinationHeaderprotected java.lang.StringcachedPathHeaderprotected JcmsContextjcmsContextprotected MemberloggedMemberprotected static booleanwebdavIpNoPatternprotected static org.apache.oro.text.regex.PatternwebdavIpPattern-
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 booleanauthenticate()This method have to do all authentication stuff with any behaviorjava.lang.StringgetDestinationHeader()Overrides WebdavContext methods to decode jcmsIds in the path.JcmsContextgetJcmsContext()MembergetLoggedMember()java.lang.StringgetPathHeader()Overrides WebdavContext methods to decode jcmsIds in the path.WebdavFileSystemgetWebdavFileSystem()voidinit(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.booleaninitAfterAuthentication()This method will initialize the WebdavContext.booleanisValideIP()static booleanrequestAuthentication(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 voidupdateProperties()-
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:
getWebdavFileSystemin 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:WebdavContextThis method will initialize the WebdavContext with given HttpServletRequest, HttpServletResponse, and ServletConfig.- Overrides:
initin classWebdavContext- Parameters:
req- the HttpServletRequestres- the HttpServletResponseconf- the ServletConfig- See Also:
WebdavContext.init(HttpServletRequest, HttpServletResponse, ServletConfig)
-
initAfterAuthentication
public boolean initAfterAuthentication()
Description copied from class:WebdavContextThis method will initialize the WebdavContext.- Overrides:
initAfterAuthenticationin classWebdavContext- Returns:
- true
- See Also:
WebdavContext.initAfterAuthentication()
-
authenticate
public boolean authenticate()
Description copied from class:WebdavContextThis method have to do all authentication stuff with any behavior- Specified by:
authenticatein 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:
getDestinationHeaderin 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:
getPathHeaderin classWebdavContext- Returns:
- String the decoded path
-
getLoggedMember
public Member getLoggedMember()
- Returns:
- Member the authentifiend LoggedMember
-
getJcmsContext
public JcmsContext getJcmsContext()
- Returns:
- JcmsContext the JcmsContext
-
-