com.jalios.jcms.webdav.cat
Class CatWebdavContext

java.lang.Object
  extended by com.jalios.jcms.webdav.WebdavContext
      extended by 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
Version:
$Revision: 28806 $
Author:
Jean-Philippe Encausse

Field Summary
protected  String cachedDestinationHeader
           
protected  String cachedPathHeader
           
protected  JcmsContext jcmsContext
           
protected  Member loggedMember
           
static String REVISION
           
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
CatWebdavContext()
           
 
Method Summary
 boolean authenticate()
          This method have to do all authentication stuff with any behavior
 String getDestinationHeader()
          Overrides WebdavContext methods to decode jcmsIds in the path.
 JcmsContext getJcmsContext()
           
 Member getLoggedMember()
           
 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/Digest
static 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_FindAllProp, writeProperties_FindByProperty, writeProperties_FindPropertyNames, writeProperties, writePropPatch, writeResponse, writeResponseProperties, writeStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

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 String cachedDestinationHeader

cachedPathHeader

protected String cachedPathHeader
Constructor Detail

CatWebdavContext

public CatWebdavContext()
Method Detail

getWebdavFileSystem

public WebdavFileSystem getWebdavFileSystem()
Specified by:
getWebdavFileSystem in class WebdavContext
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 class WebdavContext
Parameters:
req - the HttpServletRequest
res - the HttpServletResponse
conf - 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 class WebdavContext
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 class WebdavContext
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 checked
response - 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 String getDestinationHeader()
Overrides WebdavContext methods to decode jcmsIds in the path. The computation is cached for the request duration.

Overrides:
getDestinationHeader in class WebdavContext
Returns:
String the decoded path

getPathHeader

public String getPathHeader()
Overrides WebdavContext methods to decode jcmsIds in the path. The computation is cached for the request duration.

Overrides:
getPathHeader in class WebdavContext
Returns:
String the decoded path

getLoggedMember

public Member getLoggedMember()
Returns:
Member the authentifiend LoggedMember

getJcmsContext

public JcmsContext getJcmsContext()
Returns:
JcmsContext the JcmsContext


Copyright © 2001-2010 Jalios SA. All Rights Reserved.