Class WebdavController
java.lang.Object
org.craftercms.studio.controller.rest.v2.WebdavController
@Validated
@RestController
@RequestMapping("/api/2/webdav")
public class WebdavController
extends Object
Rest controller for WebDAV service
- Since:
- 3.1.4
- Author:
- joseross
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList items in a WebDAV serveruploadItem
(jakarta.servlet.http.HttpServletRequest request) Uploads a file to a WebDAV server
-
Field Details
-
webDavService
The webdav service
-
-
Constructor Details
-
WebdavController
-
-
Method Details
-
listItems
@GetMapping("list") public ResultList<WebDavItem> listItems(@NotBlank @RequestParam("siteId") @NotBlank String siteId, @NotBlank @RequestParam("profileId") @NotBlank String profileId, @RequestParam(value="path",required=false,defaultValue="") String path, @RequestParam(value="type",required=false,defaultValue="") String type) throws WebDavException, SiteNotFoundException, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException List items in a WebDAV server- Parameters:
siteId
- the id of the siteprofileId
- the id of the webdav profilepath
- the path to listtype
- the type of items to filter- Returns:
- the list of items
- Throws:
WebDavException
- if there is any error connecting to the WebDAV serverSiteNotFoundException
- if site does not existorg.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
- if the profile is not found
-
uploadItem
@PostMapping("/upload") public ResultOne<WebDavItem> uploadItem(jakarta.servlet.http.HttpServletRequest request) throws IOException, WebDavException, InvalidParametersException, SiteNotFoundException, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException, org.craftercms.commons.validation.ValidationException Uploads a file to a WebDAV server- Parameters:
request
- the request- Returns:
- the uploaded item
- Throws:
IOException
- if there is any error reading the content of the fileWebDavException
- if there is any error uploading the file to the WebDAV serverInvalidParametersException
- if there is any error parsing the requestSiteNotFoundException
- if site does not existorg.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException
- if the profile is not foundorg.craftercms.commons.validation.ValidationException
-