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 Modifier and Type Field Description protected WebDavService
webDavService
The webdav service
-
Constructor Summary
Constructors Constructor Description WebdavController(WebDavService webDavService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultList<WebDavItem>
listItems(@NotBlank String siteId, @NotBlank String profileId, String path, String type)
List items in a WebDAV serverResultOne<WebDavItem>
uploadItem(javax.servlet.http.HttpServletRequest request)
Uploads a file to a WebDAV server
-
-
-
Field Detail
-
webDavService
protected final WebDavService webDavService
The webdav service
-
-
Constructor Detail
-
WebdavController
@ConstructorProperties("webDavService") public WebdavController(WebDavService webDavService)
-
-
Method Detail
-
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(javax.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
-
-