Interface DocumentWebDavService


public interface DocumentWebDavService
  • 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.
    • isFile

      boolean isFile(String resourcePath)
      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 Path
      version - Resource Version
      baseUri - Base Request URI
      username - user login accessing the resource
      Returns:
      WebDavFileDownload containing 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 Path
      propRequestType - Requested properties retrieval type
      requestedPropertyNames - Requested property names
      requestPropertyNamesOnly - whether to get property names only or with the associated value(s)
      depth - resources retireval depth
      baseUri - Base Request URI
      username - user login accessing the resource
      Returns:
      WebDavItem corresponding 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 create
      folderType - Folder Type
      contentNodeType - Content Node Type
      mixinTypes - Folder Mixin Types
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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 Path
      fileType - File Type
      contentNodeType - Content Node Type
      mediaType - File Media Type
      mixinTypes - Mixin Types
      inputStream - File content
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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 Path
      propertiesToSave - List of properties to save
      propertiesToRemove - List of properties to remove
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - user login making the changes
      Returns:
      Map of result of changes by type of result (Http Status) and list of properties
      Throws:
      WebDavException
    • delete

      void delete(String resourcePath, List<String> lockTokens, String username) throws WebDavException
      Webdav DELETE of a given resource
      Parameters:
      resourcePath - File or Folder Path
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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 Path
      destinationPath - File destination Path
      depth - resources copy depth
      overwrite - whether to overwrite existing file if exists or not
      removeDestination - whether to remove destination if exists or not
      webDavItemProperty - WebDavItemProperty
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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 Path
      destinationPath - File destination Path
      overwrite - whether to overwrite existing file if exists or not
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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 Path
      members - List of WebDavItemOrder as identified members from WebDav client
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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 Path
      queryLanguage - Query language (XPath or SQL)
      query - Query
      baseUri - Base Request URI
      username - user login making the changes
      Returns:
      List of WebDavItem
    • enableVersioning

      void enableVersioning(String resourcePath, List<String> lockTokens, String username) throws WebDavException
      Enables Versioning on the designated resource
      Parameters:
      resourcePath - File or Folder Path
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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 Path
      requestedPropertyNames - Requested property names
      baseUri - Base Request URI
      username - user login making the changes
      Returns:
      List of WebDavItem representing the item versions
    • checkin

      void checkin(String resourcePath, List<String> lockTokens, String username) throws WebDavException
      Webdav CheckIn of a given resource in order to prepare generation of a version
      Parameters:
      resourcePath - File or Folder Path
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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

      void checkout(String resourcePath, List<String> lockTokens, String username) throws WebDavException
      Webdav CheckOut of a given resource in order to generate a version
      Parameters:
      resourcePath - File or Folder Path
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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 Path
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - 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) throws WebDavException
      Parameters:
      resourcePath - File or Folder Path
      version - 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
    • 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 Path
      depth - resources copy depth
      lockTimeout - Lock timeout
      bodyIsEmpty - whether the body doesn't exists or not
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - user login making the changes
      Returns:
      WebDavLockResponse
      Throws:
      WebDavException - when:
      • - Parameters aren't compliant to expected method inputs
      • - The designated resource is locked
    • unlock

      void unlock(String resourcePath, List<String> lockTokens, String username) throws WebDavException
      Removes a previously added lock from a designated resource
      Parameters:
      resourcePath - File or Folder Path
      lockTokens - Already Hold Lock Tokens by the WebDav Session
      username - user login making the changes
      Throws:
      WebDavException