Class SimpleWebdavServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.apache.jackrabbit.webdav.server.AbstractWebdavServlet
-
- org.apache.jackrabbit.webdav.simple.SimpleWebdavServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
,DavConstants
- Direct Known Subclasses:
SimpleWebdavServlet
public abstract class SimpleWebdavServlet extends AbstractWebdavServlet
WebdavServlet provides WebDAV support (level1
,2
,3
andbind
compliant) for repository resources.Implementations of this abstract class must implement the
getRepository()
method to access the repository.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
CTX_ATTR_RESOURCE_PATH_PREFIX
Servlet context attribute used to store the path prefix instead of having a static field with this servlet.static String
INIT_PARAM_MIME_INFO
Name of the parameter that specifies the servlet resource path of a custom <mime-info/> configuration file.static String
INIT_PARAM_RESOURCE_CONFIG
Name of the init parameter that specify a separate configuration used for filtering the resources displayed.static String
INIT_PARAM_RESOURCE_PATH_PREFIX
init param name of the repository prefix-
Fields inherited from class org.apache.jackrabbit.webdav.server.AbstractWebdavServlet
DEFAULT_AUTHENTICATE_HEADER, INIT_PARAM_AUTHENTICATE_HEADER, INIT_PARAM_CREATE_ABSOLUTE_URI, INIT_PARAM_CSRF_PROTECTION, INIT_PARAM_MISSING_AUTH_MAPPING
-
Fields inherited from interface org.apache.jackrabbit.webdav.DavConstants
creationDateFormat, DEPTH_0, DEPTH_1, DEPTH_INFINITY, DEPTH_INFINITY_S, HEADER_AUTHORIZATION, HEADER_CONTENT_LANGUAGE, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_DAV, HEADER_DEPTH, HEADER_DESTINATION, HEADER_ETAG, HEADER_IF, HEADER_LAST_MODIFIED, HEADER_LOCK_TOKEN, HEADER_OVERWRITE, HEADER_TIMEOUT, INFINITE_TIMEOUT, modificationDateFormat, NAMESPACE, OPAQUE_LOCK_TOKEN_PREFIX, PROPERTY_CREATIONDATE, PROPERTY_DISPLAYNAME, PROPERTY_GETCONTENTLANGUAGE, PROPERTY_GETCONTENTLENGTH, PROPERTY_GETCONTENTTYPE, PROPERTY_GETETAG, PROPERTY_GETLASTMODIFIED, PROPERTY_LOCKDISCOVERY, PROPERTY_RESOURCETYPE, PROPERTY_SOURCE, PROPERTY_SUPPORTEDLOCK, PROPFIND_ALL_PROP, PROPFIND_ALL_PROP_INCLUDE, PROPFIND_BY_PROPERTY, PROPFIND_PROPERTY_NAMES, TIMEOUT_INFINITE, UNDEFINED_TIME, UNDEFINED_TIMEOUT, XML_ACTIVELOCK, XML_ALLPROP, XML_COLLECTION, XML_DEPTH, XML_DST, XML_EXCLUSIVE, XML_HREF, XML_INCLUDE, XML_KEEPALIVE, XML_LINK, XML_LOCKENTRY, XML_LOCKINFO, XML_LOCKROOT, XML_LOCKSCOPE, XML_LOCKTOKEN, XML_LOCKTYPE, XML_MULTISTATUS, XML_OMIT, XML_OWNER, XML_PROP, XML_PROPERTYBEHAVIOR, XML_PROPERTYUPDATE, XML_PROPFIND, XML_PROPNAME, XML_PROPSTAT, XML_REMOVE, XML_RESPONSE, XML_RESPONSEDESCRIPTION, XML_SET, XML_SHARED, XML_SOURCE, XML_STATUS, XML_TIMEOUT, XML_WRITE
-
-
Constructor Summary
Constructors Constructor Description SimpleWebdavServlet()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected CredentialsProvider
getCredentialsProvider()
Factory method for creating the credentials provider to be used for accessing the credentials associated with a request.DavSessionProvider
getDavSessionProvider()
Returns theDavSessionProvider
.DavLocatorFactory
getLocatorFactory()
Returns theDavLocatorFactory
.LockManager
getLockManager()
Returns theLockManager
.String
getPathPrefix()
Returns the configured path prefixstatic String
getPathPrefix(javax.servlet.ServletContext ctx)
Returns the configured path prefixabstract Repository
getRepository()
Returns theRepository
.ResourceConfig
getResourceConfig()
Returns the resource configuration to be appliedDavResourceFactory
getResourceFactory()
Returns theDavResourceFactory
.SessionProvider
getSessionProvider()
Returns theSessionProvider
.void
init()
Init this servletprotected boolean
isPreconditionValid(WebdavRequest request, DavResource resource)
Checks if the precondition for this request and resource is valid.void
setDavSessionProvider(DavSessionProvider sessionProvider)
Sets theDavSessionProvider
.void
setLocatorFactory(DavLocatorFactory locatorFactory)
Sets theDavLocatorFactory
.void
setLockManager(LockManager lockManager)
Sets theLockManager
.void
setResourceConfig(ResourceConfig config)
Set the resource configurationvoid
setResourceFactory(DavResourceFactory resourceFactory)
Sets theDavResourceFactory
.void
setSessionProvider(SessionProvider sessionProvider)
Sets theSessionProvider
.-
Methods inherited from class org.apache.jackrabbit.webdav.server.AbstractWebdavServlet
doAcl, doBaselineControl, doBind, doCheckin, doCheckout, doCopy, doDelete, doGet, doHead, doLabel, doLock, doMerge, doMkActivity, doMkCol, doMkWorkspace, doMove, doOptions, doOrderPatch, doPoll, doPost, doPropFind, doPropPatch, doPut, doRebind, doReport, doSearch, doSubscribe, doUnbind, doUncheckout, doUnlock, doUnsubscribe, doUpdate, doVersionControl, execute, getAuthenticateHeaderValue, getContentCodings, getInputContext, getOutputContext, getSingletonField, isCreateAbsoluteURI, sendUnauthorized, service, validateDestination
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
INIT_PARAM_RESOURCE_PATH_PREFIX
public static final String INIT_PARAM_RESOURCE_PATH_PREFIX
init param name of the repository prefix- See Also:
- Constant Field Values
-
INIT_PARAM_RESOURCE_CONFIG
public static final String INIT_PARAM_RESOURCE_CONFIG
Name of the init parameter that specify a separate configuration used for filtering the resources displayed.- See Also:
- Constant Field Values
-
INIT_PARAM_MIME_INFO
public static final String INIT_PARAM_MIME_INFO
Name of the parameter that specifies the servlet resource path of a custom <mime-info/> configuration file. The default setting is to use the MIME media type database included in Apache Tika.- See Also:
- Constant Field Values
-
CTX_ATTR_RESOURCE_PATH_PREFIX
public static final String CTX_ATTR_RESOURCE_PATH_PREFIX
Servlet context attribute used to store the path prefix instead of having a static field with this servlet. The latter causes problems when running multiple- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletException
Init this servlet- Overrides:
init
in classAbstractWebdavServlet
- Throws:
javax.servlet.ServletException
-
isPreconditionValid
protected boolean isPreconditionValid(WebdavRequest request, DavResource resource)
Checks if the precondition for this request and resource is valid.- Specified by:
isPreconditionValid
in classAbstractWebdavServlet
- Returns:
-
getPathPrefix
public String getPathPrefix()
Returns the configured path prefix- Returns:
- resourcePathPrefix
- See Also:
INIT_PARAM_RESOURCE_PATH_PREFIX
-
getPathPrefix
public static String getPathPrefix(javax.servlet.ServletContext ctx)
Returns the configured path prefix- Parameters:
ctx
- The servlet context.- Returns:
- resourcePathPrefix
- See Also:
INIT_PARAM_RESOURCE_PATH_PREFIX
-
getLocatorFactory
public DavLocatorFactory getLocatorFactory()
Returns theDavLocatorFactory
. If no locator factory has been set or created a new instance ofLocatorFactoryImpl
is returned.- Specified by:
getLocatorFactory
in classAbstractWebdavServlet
- Returns:
- the locator factory
- See Also:
AbstractWebdavServlet.getLocatorFactory()
-
setLocatorFactory
public void setLocatorFactory(DavLocatorFactory locatorFactory)
Sets theDavLocatorFactory
.- Specified by:
setLocatorFactory
in classAbstractWebdavServlet
- Parameters:
locatorFactory
- TheDavLocatorFactory
to use.- See Also:
AbstractWebdavServlet.setLocatorFactory(DavLocatorFactory)
-
getLockManager
public LockManager getLockManager()
Returns theLockManager
. If no lock manager has been set or created a new instance ofSimpleLockManager
is returned.- Returns:
- the lock manager
-
setLockManager
public void setLockManager(LockManager lockManager)
Sets theLockManager
.- Parameters:
lockManager
- TheLockManager
to be used.
-
getResourceFactory
public DavResourceFactory getResourceFactory()
Returns theDavResourceFactory
. If no request factory has been set or created a new instance ofResourceFactoryImpl
is returned.- Specified by:
getResourceFactory
in classAbstractWebdavServlet
- Returns:
- the resource factory
- See Also:
AbstractWebdavServlet.getResourceFactory()
-
setResourceFactory
public void setResourceFactory(DavResourceFactory resourceFactory)
Sets theDavResourceFactory
.- Specified by:
setResourceFactory
in classAbstractWebdavServlet
- Parameters:
resourceFactory
- TheDavResourceFactory
to use.- See Also:
AbstractWebdavServlet.setResourceFactory(org.apache.jackrabbit.webdav.DavResourceFactory)
-
getSessionProvider
public SessionProvider getSessionProvider()
Returns theSessionProvider
. If no session provider has been set or created a new instance ofSessionProviderImpl
that extracts credentials from theAuthorization
request header is returned.- Returns:
- the session provider
-
getCredentialsProvider
protected CredentialsProvider getCredentialsProvider()
Factory method for creating the credentials provider to be used for accessing the credentials associated with a request. The default implementation returns aBasicCredentialsProvider
instance, but subclasses can override this method to add support for other types of credentials.- Returns:
- the credentials provider
- Since:
- 1.3
-
setSessionProvider
public void setSessionProvider(SessionProvider sessionProvider)
Sets theSessionProvider
.- Parameters:
sessionProvider
- TheSessionProvider
to use.
-
getDavSessionProvider
public DavSessionProvider getDavSessionProvider()
Returns theDavSessionProvider
. If no session provider has been set or created a new instance ofDavSessionProviderImpl
is returned.- Specified by:
getDavSessionProvider
in classAbstractWebdavServlet
- Returns:
- the session provider
- See Also:
AbstractWebdavServlet.getDavSessionProvider()
-
setDavSessionProvider
public void setDavSessionProvider(DavSessionProvider sessionProvider)
Sets theDavSessionProvider
.- Specified by:
setDavSessionProvider
in classAbstractWebdavServlet
- Parameters:
sessionProvider
- TheDavSessionProvider
to use.- See Also:
AbstractWebdavServlet.setDavSessionProvider(org.apache.jackrabbit.webdav.DavSessionProvider)
-
getResourceConfig
public ResourceConfig getResourceConfig()
Returns the resource configuration to be applied- Returns:
- the resource configuration.
-
setResourceConfig
public void setResourceConfig(ResourceConfig config)
Set the resource configuration- Parameters:
config
- The resource configuration.
-
getRepository
public abstract Repository getRepository()
Returns theRepository
. If no repository has been set or created the repository initialized byRepositoryAccessServlet
is returned.- Returns:
- repository
-
-