Class WebDavServiceImpl
java.lang.Object
org.craftercms.studio.impl.v2.service.webdav.WebDavServiceImpl
- All Implemented Interfaces:
WebDavService
Default implementation of
WebDavService.- Since:
- 3.1.4
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CharsetCharset used to encode paths in URLs.static final Stringprotected SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.webdav.WebDavProfile>Instance ofSiteAwareConfigProfileLoaderused to load the configuration file.protected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetName(com.github.sardine.DavResource resource) protected org.craftercms.commons.config.profiles.webdav.WebDavProfilegetProfile(String site, String profileId) protected StringgetRemoteAssetUrl(String profileId, String fullPath) protected StringgetRemoteAssetUrl(String profileId, String path, String filename) protected StringgetUrl(com.github.sardine.DavResource resource, String profileId, org.craftercms.commons.config.profiles.webdav.WebDavProfile profile) @Valid List<WebDavItem>Lists resources in the specified path.voidsetProfileLoader(SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.webdav.WebDavProfile> profileLoader) voidsetUrlPattern(String urlPattern) @Valid WebDavItemUploads a file in the specified path.
-
Field Details
-
FILTER_ALL_ITEMS
- See Also:
-
urlPattern
-
profileLoader
protected SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.webdav.WebDavProfile> profileLoaderInstance ofSiteAwareConfigProfileLoaderused to load the configuration file. -
charset
Charset used to encode paths in URLs.
-
-
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:
WebDavExceptionorg.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:
listin interfaceWebDavService- Parameters:
siteId- the id of the siteprofileId- the id of the profilepath- the relative path to listtype- mime type used for filtering- Returns:
- list of resources found
- Throws:
WebDavException- if there is an error connecting to the server or listing the resourcesSiteNotFoundException- if the site is not foundorg.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException- if the profile is not found
-
getUrl
-
getRemoteAssetUrl
-
getRemoteAssetUrl
-
getName
-
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:
uploadin interfaceWebDavService- Parameters:
siteId- the id of the siteprofileId- the id of the profilepath- the relative path to upload the filefilename- the name of the file to uploadcontent- 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 fileSiteNotFoundException- if the site is not foundorg.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException- if the profile is not found
-
setUrlPattern
-
setProfileLoader
public void setProfileLoader(SiteAwareConfigProfileLoader<org.craftercms.commons.config.profiles.webdav.WebDavProfile> profileLoader)
-