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,3andbindcompliant) 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 StringCTX_ATTR_RESOURCE_PATH_PREFIXServlet context attribute used to store the path prefix instead of having a static field with this servlet.static StringINIT_PARAM_MIME_INFOName of the parameter that specifies the servlet resource path of a custom <mime-info/> configuration file.static StringINIT_PARAM_RESOURCE_CONFIGName of the init parameter that specify a separate configuration used for filtering the resources displayed.static StringINIT_PARAM_RESOURCE_PATH_PREFIXinit 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 CredentialsProvidergetCredentialsProvider()Factory method for creating the credentials provider to be used for accessing the credentials associated with a request.DavSessionProvidergetDavSessionProvider()Returns theDavSessionProvider.DavLocatorFactorygetLocatorFactory()Returns theDavLocatorFactory.LockManagergetLockManager()Returns theLockManager.StringgetPathPrefix()Returns the configured path prefixstatic StringgetPathPrefix(javax.servlet.ServletContext ctx)Returns the configured path prefixabstract RepositorygetRepository()Returns theRepository.ResourceConfiggetResourceConfig()Returns the resource configuration to be appliedDavResourceFactorygetResourceFactory()Returns theDavResourceFactory.SessionProvidergetSessionProvider()Returns theSessionProvider.voidinit()Init this servletprotected booleanisPreconditionValid(WebdavRequest request, DavResource resource)Checks if the precondition for this request and resource is valid.voidsetDavSessionProvider(DavSessionProvider sessionProvider)Sets theDavSessionProvider.voidsetLocatorFactory(DavLocatorFactory locatorFactory)Sets theDavLocatorFactory.voidsetLockManager(LockManager lockManager)Sets theLockManager.voidsetResourceConfig(ResourceConfig config)Set the resource configurationvoidsetResourceFactory(DavResourceFactory resourceFactory)Sets theDavResourceFactory.voidsetSessionProvider(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.ServletExceptionInit this servlet- Overrides:
initin 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:
isPreconditionValidin 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 ofLocatorFactoryImplis returned.- Specified by:
getLocatorFactoryin classAbstractWebdavServlet- Returns:
- the locator factory
- See Also:
AbstractWebdavServlet.getLocatorFactory()
-
setLocatorFactory
public void setLocatorFactory(DavLocatorFactory locatorFactory)
Sets theDavLocatorFactory.- Specified by:
setLocatorFactoryin classAbstractWebdavServlet- Parameters:
locatorFactory- TheDavLocatorFactoryto use.- See Also:
AbstractWebdavServlet.setLocatorFactory(DavLocatorFactory)
-
getLockManager
public LockManager getLockManager()
Returns theLockManager. If no lock manager has been set or created a new instance ofSimpleLockManageris returned.- Returns:
- the lock manager
-
setLockManager
public void setLockManager(LockManager lockManager)
Sets theLockManager.- Parameters:
lockManager- TheLockManagerto be used.
-
getResourceFactory
public DavResourceFactory getResourceFactory()
Returns theDavResourceFactory. If no request factory has been set or created a new instance ofResourceFactoryImplis returned.- Specified by:
getResourceFactoryin classAbstractWebdavServlet- Returns:
- the resource factory
- See Also:
AbstractWebdavServlet.getResourceFactory()
-
setResourceFactory
public void setResourceFactory(DavResourceFactory resourceFactory)
Sets theDavResourceFactory.- Specified by:
setResourceFactoryin classAbstractWebdavServlet- Parameters:
resourceFactory- TheDavResourceFactoryto 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 ofSessionProviderImplthat extracts credentials from theAuthorizationrequest 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 aBasicCredentialsProviderinstance, 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- TheSessionProviderto use.
-
getDavSessionProvider
public DavSessionProvider getDavSessionProvider()
Returns theDavSessionProvider. If no session provider has been set or created a new instance ofDavSessionProviderImplis returned.- Specified by:
getDavSessionProviderin classAbstractWebdavServlet- Returns:
- the session provider
- See Also:
AbstractWebdavServlet.getDavSessionProvider()
-
setDavSessionProvider
public void setDavSessionProvider(DavSessionProvider sessionProvider)
Sets theDavSessionProvider.- Specified by:
setDavSessionProviderin classAbstractWebdavServlet- Parameters:
sessionProvider- TheDavSessionProviderto 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 byRepositoryAccessServletis returned.- Returns:
- repository
-
-