Class WebDavServiceImpl

    • Constructor Detail

      • WebDavServiceImpl

        public WebDavServiceImpl()
    • Method Detail

      • list

        public List<WebDavItem> list​(String siteId,
                                     String profileId,
                                     String path,
                                     String type)
                              throws WebDavException
        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
      • 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)
      • getName

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

        public WebDavItem upload​(String siteId,
                                 String profileId,
                                 String path,
                                 String filename,
                                 InputStream content)
                          throws WebDavException
        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
      • getUrlPattern

        public String getUrlPattern()
      • setUrlPattern

        public void setUrlPattern​(String urlPattern)
      • setProfileLoader

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