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 Details

    • webDavService

      protected final WebDavService webDavService
      The webdav service
  • Constructor Details

  • 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 site
      profileId - the id of the webdav profile
      path - the path to list
      type - the type of items to filter
      Returns:
      the list of items
      Throws:
      WebDavException - if there is any error connecting to the WebDAV server
      SiteNotFoundException - if site does not exist
      org.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 file
      WebDavException - if there is any error uploading the file to the WebDAV server
      InvalidParametersException - if there is any error parsing the request
      SiteNotFoundException - if site does not exist
      org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException - if the profile is not found
      org.craftercms.commons.validation.ValidationException