Class WebDavServiceImpl

java.lang.Object
org.craftercms.studio.impl.v2.service.webdav.WebDavServiceImpl
All Implemented Interfaces:
WebDavService

public class WebDavServiceImpl extends Object implements WebDavService
Default implementation of WebDavService.
Since:
3.1.4
Author:
joseross
  • Field Details

  • Constructor Details

    • WebDavServiceImpl

      public WebDavServiceImpl()
  • Method Details

    • getProfile

      protected org.craftercms.commons.config.profiles.webdav.WebDavProfile getProfile(String site, String profileId) throws WebDavException, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
      Throws:
      WebDavException
      org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
    • list

      @Valid public @Valid List<WebDavItem> list(String siteId, String profileId, String path, String type) throws WebDavException, SiteNotFoundException, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
      Lists resources in the specified path.
      Specified by:
      list in interface WebDavService
      Parameters:
      siteId - the id of the site
      profileId - the id of the profile
      path - the relative path to list
      type - mime type used for filtering
      Returns:
      list of resources found
      Throws:
      WebDavException - if there is an error connecting to the server or listing the resources
      SiteNotFoundException - if the site is not found
      org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException - if the profile is not found
    • getUrl

      protected String getUrl(com.github.sardine.DavResource resource, String profileId, org.craftercms.commons.config.profiles.webdav.WebDavProfile profile)
    • getRemoteAssetUrl

      protected String getRemoteAssetUrl(String profileId, String fullPath)
    • getRemoteAssetUrl

      protected String getRemoteAssetUrl(String profileId, String path, String filename)
    • getName

      protected String getName(com.github.sardine.DavResource resource)
    • upload

      @Valid public @Valid WebDavItem upload(String siteId, String profileId, String path, String filename, InputStream content) throws WebDavException, SiteNotFoundException, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
      Uploads a file in the specified path.
      Specified by:
      upload in interface WebDavService
      Parameters:
      siteId - the id of the site
      profileId - the id of the profile
      path - the relative path to upload the file
      filename - the name of the file to upload
      content - stream providing the content of the file
      Returns:
      the uploaded item
      Throws:
      WebDavException - if there is an error connecting to the server or uploading the file
      SiteNotFoundException - if the site is not found
      org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException - if the profile is not found
    • setUrlPattern

      public void setUrlPattern(String urlPattern)
    • setProfileLoader

      public void setProfileLoader(SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.webdav.WebDavProfile> profileLoader)