Interface DocumentWebDavService
public interface DocumentWebDavService
-
Method Summary
Modifier and TypeMethodDescriptionvoidWebdav CheckIn of a given resource in order to prepare generation of a versionvoidWebdav CheckOut of a given resource in order to generate a versionvoidcopy(String resourcePath, String destinationPath, int depth, boolean overwrite, boolean removeDestination, WebDavItemProperty webDavItemProperty, List<String> lockTokens, String username) Webdav COPY of a given resource into a designated resource pathvoidcreateFolder(String resourcePath, String folderType, String contentNodeType, String mixinTypes, List<String> lockTokens, String username) Creates a new folder in the designated locationvoidWebdav DELETE of a given resourceWebdav GET of a given resourcevoidenableVersioning(String resourcePath, List<String> lockTokens, String username) Enables Versioning on the designated resourceget(String resourcePath, String propRequestType, Set<QName> requestedPropertyNames, boolean requestPropertyNamesOnly, int depth, String baseUri, String username) longgetLastModifiedDate(String resourcePath, String version) Deprecated.kept for binary compatibility only.longgetLastModifiedDate(String resourcePath, String version, String username) getVersions(String resourcePath, Set<QName> requestedPropertyNames, String baseUri, String username) getWebDavPath(String jcrPath, String username) Returns the WebDav Path of a given JCR PathbooleanDeprecated.kept for binary compatibility only.booleanlock(String resourcePath, int depth, int lockTimeout, boolean bodyIsEmpty, List<String> lockTokens, String username) Add a lock on a designated resourcebooleanmove(String resourcePath, String destinationPath, boolean overwrite, List<String> lockTokens, String username) booleanvoidsaveFile(String resourcePath, String fileType, String contentNodeType, String mediaType, String mixinTypes, InputStream inputStream, List<String> lockTokens, String username) Creates or Updates a designated resourcesaveProperties(String resourcePath, List<WebDavItemProperty> propertiesToSave, List<WebDavItemProperty> propertiesToRemove, List<String> lockTokens, String username) Create, update and delete properties of a designated resourcetoWebDavException(Throwable throwable) Translates a failure raised by the storage implementation into the HTTP status it means, so that the transport layer does not have to know the storage's exception types.voiduncheckout(String resourcePath, List<String> lockTokens, String username) voidRemoves a previously added lock from a designated resource
-
Method Details
-
getNamespaceContext
NamespaceContext getNamespaceContext()- Returns:
NamespaceContext,which will be used to write XML namespaces in resulted responses
-
getDaslValue
String getDaslValue()- Returns:
- HTTP 1.1 "Allow" header. See WebDAV/DASL Request and Response Syntax for more information.
-
toWebDavException
Translates a failure raised by the storage implementation into the HTTP status it means, so that the transport layer does not have to know the storage's exception types. A repository that refuses an operation the user has no right to, for instance, means 403 and not 500.- Parameters:
throwable- the failure a WebDAV operation raised- Returns:
- the exception to answer with, or null when the failure is not one the contract covers — which really is a 500
-
isFile
- Parameters:
resourcePath- File or Folder Pathusername- the user asking, whose own rights decide the answer: this reports on a resource they may have no right to see, so it is resolved against their session and not a system one- Returns:
- true if the resource designated by the path is a file, else false.
Note that on a path this user cannot resolve the implementation
raises a
WebDavExceptionrather than returning false — it comes from the path resolution the authoritative lookup goes through, and escapes this signature because the implementation sneaky-throws it.
-
isFile
Deprecated.kept for binary compatibility only. It resolves the path with a system session, so it answers for any caller whatever their rights, and must not be used where the answer concerns a resource the caller may not be allowed to see. UseisFile(String, String), which resolves against the caller's own session. Since 7.3.x; not scheduled for removal.- Parameters:
resourcePath- File or Folder Path- Returns:
- true if the resource designated by the path is a file, else false
-
download
WebDavFileDownload download(String resourcePath, String version, String baseUri, String username) throws WebDavException Webdav GET of a given resource- Parameters:
resourcePath- File or Folder Pathversion- Resource VersionbaseUri- Base Request URIusername- user login accessing the resource- Returns:
WebDavFileDownloadcontaining the content of the file- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resource
- - The designated resource isn't found
-
get
WebDavItem get(String resourcePath, String propRequestType, Set<QName> requestedPropertyNames, boolean requestPropertyNamesOnly, int depth, String baseUri, String username) throws WebDavException - Parameters:
resourcePath- File or Folder PathpropRequestType- Requested properties retrieval typerequestedPropertyNames- Requested property namesrequestPropertyNamesOnly- whether to get property names only or with the associated value(s)depth- resources retireval depthbaseUri- Base Request URIusername- user login accessing the resource- Returns:
WebDavItemcorresponding to the requested resource- Throws:
WebDavException
-
createFolder
void createFolder(String resourcePath, String folderType, String contentNodeType, String mixinTypes, List<String> lockTokens, String username) throws WebDavException Creates a new folder in the designated location- Parameters:
resourcePath- Folder Path to createfolderType- Folder TypecontentNodeType- Content Node TypemixinTypes- Folder Mixin TypeslockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resource
- - The designated resource isn't found
- - The designated resource is locked
-
saveFile
void saveFile(String resourcePath, String fileType, String contentNodeType, String mediaType, String mixinTypes, InputStream inputStream, List<String> lockTokens, String username) throws WebDavException Creates or Updates a designated resource- Parameters:
resourcePath- File or Folder PathfileType- File TypecontentNodeType- Content Node TypemediaType- File Media TypemixinTypes- Mixin TypesinputStream- File contentlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resource
- - The designated parent of the resource isn't found
- - The designated resource is locked
-
saveProperties
Map<String,Collection<WebDavItemProperty>> saveProperties(String resourcePath, List<WebDavItemProperty> propertiesToSave, List<WebDavItemProperty> propertiesToRemove, List<String> lockTokens, String username) throws WebDavException Create, update and delete properties of a designated resource- Parameters:
resourcePath- File or Folder PathpropertiesToSave-Listof properties to savepropertiesToRemove-Listof properties to removelockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Returns:
Mapof result of changes by type of result (Http Status) and list of properties- Throws:
WebDavException
-
delete
Webdav DELETE of a given resource- Parameters:
resourcePath- File or Folder PathlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resource
- - The designated resource isn't found
-
copy
void copy(String resourcePath, String destinationPath, int depth, boolean overwrite, boolean removeDestination, WebDavItemProperty webDavItemProperty, List<String> lockTokens, String username) throws WebDavException Webdav COPY of a given resource into a designated resource path- Parameters:
resourcePath- File or Folder PathdestinationPath- File destination Pathdepth- resources copy depthoverwrite- whether to overwrite existing file if exists or notremoveDestination- whether to remove destination if exists or notwebDavItemProperty-WebDavItemPropertylockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resource
- - The designated resource isn't found
- - The destination designated resource path already exists and overwrite = false
-
move
boolean move(String resourcePath, String destinationPath, boolean overwrite, List<String> lockTokens, String username) throws WebDavException - Parameters:
resourcePath- File or Folder PathdestinationPath- File destination Pathoverwrite- whether to overwrite existing file if exists or notlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Returns:
- true if item already exists and was replaced else false
- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resources
- - The designated source resource isn't found
- - The destination designated resource path already exists and overwrite = false
-
order
boolean order(String resourcePath, List<WebDavItemOrder> members, List<String> lockTokens, String username) throws WebDavException - Parameters:
resourcePath- File or Folder Pathmembers-ListofWebDavItemOrderas identified members from WebDav clientlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Returns:
- true if order change applied else false
- Throws:
WebDavException
-
search
List<WebDavItem> search(String resourcePath, String queryLanguage, String query, String baseUri, String username) - Parameters:
resourcePath- File or Folder PathqueryLanguage- Query language (XPath or SQL)query- QuerybaseUri- Base Request URIusername- user login making the changes- Returns:
ListofWebDavItem
-
enableVersioning
void enableVersioning(String resourcePath, List<String> lockTokens, String username) throws WebDavException Enables Versioning on the designated resource- Parameters:
resourcePath- File or Folder PathlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException- when:- - The user doesn't have access to designated resource
- - The designated resource isn't found
- - The designated resource is locked
-
getVersions
List<WebDavItem> getVersions(String resourcePath, Set<QName> requestedPropertyNames, String baseUri, String username) - Parameters:
resourcePath- File or Folder PathrequestedPropertyNames- Requested property namesbaseUri- Base Request URIusername- user login making the changes- Returns:
ListofWebDavItemrepresenting the item versions
-
checkin
Webdav CheckIn of a given resource in order to prepare generation of a version- Parameters:
resourcePath- File or Folder PathlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resource
- - The designated resource isn't found
- - The designated resource is already checked in
- - The designated resource is locked
-
checkout
Webdav CheckOut of a given resource in order to generate a version- Parameters:
resourcePath- File or Folder PathlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resource
- - The designated resource isn't found
- - The designated resource is already checked out
-
uncheckout
void uncheckout(String resourcePath, List<String> lockTokens, String username) throws WebDavException - Parameters:
resourcePath- File or Folder PathlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The user doesn't have access to designated resource
- - The designated resource isn't found
- - The designated resource is not checked out
-
getLastModifiedDate
long getLastModifiedDate(String resourcePath, String version, String username) throws WebDavException - Parameters:
resourcePath- File or Folder Pathversion- File version- Returns:
- last Modified Date of a resource designated by its path
- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The designated resource isn't found
-
getLastModifiedDate
@Deprecated(since="7.3.x") long getLastModifiedDate(String resourcePath, String version) throws WebDavException Deprecated.kept for binary compatibility only. It resolves the path with a system session, so it answers for any caller whatever their rights — a conditional request answered from it discloses a resource's existence and its exact modification date. UsegetLastModifiedDate(String, String, String), which resolves against the caller's own session. Since 7.3.x; not scheduled for removal.- Parameters:
resourcePath- File or Folder Pathversion- version name, null for the head- Returns:
- the last modification date in milliseconds, 0 when there is none
- Throws:
WebDavException- when the resource cannot be resolved
-
lock
WebDavLockResponse lock(String resourcePath, int depth, int lockTimeout, boolean bodyIsEmpty, List<String> lockTokens, String username) throws WebDavException Add a lock on a designated resource- Parameters:
resourcePath- File or Folder Pathdepth- resources copy depthlockTimeout- Lock timeoutbodyIsEmpty- whether the body doesn't exists or notlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Returns:
WebDavLockResponse- Throws:
WebDavException- when:- - Parameters aren't compliant to expected method inputs
- - The designated resource is locked
-
unlock
Removes a previously added lock from a designated resource- Parameters:
resourcePath- File or Folder PathlockTokens- Already Hold Lock Tokens by the WebDav Sessionusername- user login making the changes- Throws:
WebDavException
-
getWebDavPath
Returns the WebDav Path of a given JCR Path- Parameters:
jcrPath- JCR Full Pathusername- user login accessing the file- Returns:
- WebDav Path
- Throws:
WebDavException- when not permitted or not found
-