Ejemplo n.º 1
0
  public static Resource getResource(
      WebDAVRequest webDAVRequest, String rootPath, String token, long classNameId)
      throws WebDAVException {

    try {
      String[] pathArray = webDAVRequest.getPathArray();

      if (pathArray.length == 2) {
        String path = rootPath + webDAVRequest.getPath();

        return new BaseResourceImpl(path, StringPool.BLANK, token);
      } else if (pathArray.length == 3) {
        String type = pathArray[2];

        return toResource(webDAVRequest, type, rootPath, false);
      } else if (pathArray.length == 4) {
        String type = pathArray[2];
        String typeId = pathArray[3];

        if (type.equals(TYPE_STRUCTURES)) {
          try {
            DDMStructure structure = null;

            try {
              structure = DDMStructureLocalServiceUtil.getStructure(GetterUtil.getLong(typeId));
            } catch (NumberFormatException nfe) {
              structure =
                  DDMStructureLocalServiceUtil.getStructure(
                      webDAVRequest.getGroupId(), classNameId, typeId);
            }

            return DDMWebDavUtil.toResource(webDAVRequest, structure, rootPath, false);
          } catch (NoSuchStructureException nsse) {
            return null;
          }
        } else if (type.equals(TYPE_TEMPLATES)) {
          try {
            DDMTemplate template = null;

            try {
              template = DDMTemplateLocalServiceUtil.getTemplate(GetterUtil.getLong(typeId));
            } catch (NumberFormatException nfe) {
              template =
                  DDMTemplateLocalServiceUtil.getTemplate(
                      webDAVRequest.getGroupId(), classNameId, typeId);
            }

            return DDMWebDavUtil.toResource(webDAVRequest, template, rootPath, false);
          } catch (NoSuchTemplateException nste) {
            return null;
          }
        }
      }

      return null;
    } catch (Exception e) {
      throw new WebDAVException(e);
    }
  }
Ejemplo n.º 2
0
  public static int addResource(WebDAVRequest webDavRequest, long classNameId) throws Exception {

    String[] pathArray = webDavRequest.getPathArray();

    if (pathArray.length != 4) {
      return HttpServletResponse.SC_FORBIDDEN;
    }

    String type = pathArray[2];
    String typeId = pathArray[3];

    if (type.equals(TYPE_STRUCTURES)) {
      HttpServletRequest request = webDavRequest.getHttpServletRequest();

      String definition = StringUtil.read(request.getInputStream());

      DDMForm ddmForm = getDDMForm(definition);

      DDMFormLayout ddmFormLayout = DDMUtil.getDefaultDDMFormLayout(ddmForm);

      Map<Locale, String> nameMap = new HashMap<>();

      Locale defaultLocale = ddmForm.getDefaultLocale();

      nameMap.put(defaultLocale, typeId);

      ServiceContext serviceContext = new ServiceContext();

      serviceContext.setAddGroupPermissions(true);
      serviceContext.setAddGuestPermissions(true);

      DDMStructureLocalServiceUtil.addStructure(
          webDavRequest.getUserId(),
          webDavRequest.getGroupId(),
          classNameId,
          nameMap,
          null,
          ddmForm,
          ddmFormLayout,
          StorageType.JSON.toString(),
          serviceContext);

      return HttpServletResponse.SC_CREATED;
    } else if (type.equals(TYPE_TEMPLATES)) {

      // DDM templates can not be added via WebDAV because there is no way
      // to know the associated class name or class PK

      return HttpServletResponse.SC_FORBIDDEN;
    }

    return HttpServletResponse.SC_FORBIDDEN;
  }
  public DLFileEntryResourceImpl(
      WebDAVRequest webDAVRequest, FileEntry fileEntry, boolean appendPath) {

    super(
        webDAVRequest.getRootPath() + webDAVRequest.getPath(),
        _getName(fileEntry, appendPath),
        _getName(fileEntry, true),
        fileEntry.getCreateDate(),
        fileEntry.getModifiedDate(),
        fileEntry.getSize());

    setModel(fileEntry);
    setClassName(DLFileEntry.class.getName());
    setPrimaryKey(fileEntry.getPrimaryKey());
  }
Ejemplo n.º 4
0
  public List<Resource> getResources(WebDAVRequest webDavRequest) throws WebDAVException {

    try {
      long folderId = getFolderId(webDavRequest.getCompanyId(), webDavRequest.getPathArray());

      List<Resource> folders = getFolders(webDavRequest, folderId);
      List<Resource> images = getImages(webDavRequest, folderId);

      List<Resource> resources = new ArrayList<Resource>(folders.size() + images.size());

      resources.addAll(folders);
      resources.addAll(images);

      return resources;
    } catch (Exception e) {
      throw new WebDAVException(e);
    }
  }
Ejemplo n.º 5
0
  public int copyCollectionResource(
      WebDAVRequest webDavRequest,
      Resource resource,
      String destination,
      boolean overwrite,
      long depth)
      throws WebDAVException {

    try {
      String[] destinationArray = WebDAVUtil.getPathArray(destination, true);

      long companyId = webDavRequest.getCompanyId();

      long parentFolderId = IGFolderConstants.DEFAULT_PARENT_FOLDER_ID;

      try {
        parentFolderId = getParentFolderId(companyId, destinationArray);
      } catch (NoSuchFolderException nsfe) {
        return HttpServletResponse.SC_CONFLICT;
      }

      IGFolder folder = (IGFolder) resource.getModel();

      long groupId = WebDAVUtil.getGroupId(companyId, destination);
      String name = WebDAVUtil.getResourceName(destinationArray);
      String description = folder.getDescription();

      int status = HttpServletResponse.SC_CREATED;

      if (overwrite) {
        if (deleteResource(groupId, parentFolderId, name)) {
          status = HttpServletResponse.SC_NO_CONTENT;
        }
      }

      ServiceContext serviceContext = new ServiceContext();

      serviceContext.setAddCommunityPermissions(isAddCommunityPermissions(groupId));
      serviceContext.setAddGuestPermissions(true);
      serviceContext.setScopeGroupId(groupId);

      if (depth == 0) {
        IGFolderServiceUtil.addFolder(parentFolderId, name, description, serviceContext);
      } else {
        IGFolderServiceUtil.copyFolder(
            folder.getFolderId(), parentFolderId, name, description, serviceContext);
      }

      return status;
    } catch (DuplicateFolderNameException dfne) {
      return HttpServletResponse.SC_PRECONDITION_FAILED;
    } catch (PrincipalException pe) {
      return HttpServletResponse.SC_FORBIDDEN;
    } catch (Exception e) {
      throw new WebDAVException(e);
    }
  }
Ejemplo n.º 6
0
  protected Resource toResource(WebDAVRequest webDavRequest, IGImage image, boolean appendPath) {

    String parentPath = getRootPath() + webDavRequest.getPath();
    String name = StringPool.BLANK;

    if (appendPath) {
      name = image.getNameWithExtension();
    }

    return new IGImageResourceImpl(image, parentPath, name);
  }
Ejemplo n.º 7
0
  public static Resource toResource(
      WebDAVRequest webDAVRequest, DDMTemplate template, String rootPath, boolean appendPath) {

    String parentPath = rootPath + webDAVRequest.getPath();

    String name = StringPool.BLANK;

    if (appendPath) {
      name = String.valueOf(template.getTemplateId());
    }

    return new DDMTemplateResourceImpl(template, parentPath, name);
  }
Ejemplo n.º 8
0
  public Status makeCollection(WebDAVRequest webDavRequest) throws WebDAVException {

    try {
      HttpServletRequest request = webDavRequest.getHttpServletRequest();

      if (request.getContentLength() > 0) {
        return new Status(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE);
      }

      String[] pathArray = webDavRequest.getPathArray();

      long companyId = webDavRequest.getCompanyId();
      long groupId = webDavRequest.getGroupId();
      long parentFolderId = getParentFolderId(companyId, pathArray);
      String name = WebDAVUtil.getResourceName(pathArray);
      String description = StringPool.BLANK;

      ServiceContext serviceContext = new ServiceContext();

      serviceContext.setAddCommunityPermissions(isAddCommunityPermissions(groupId));
      serviceContext.setAddGuestPermissions(true);
      serviceContext.setPlid(getPlid(webDavRequest.getGroupId()));
      serviceContext.setScopeGroupId(webDavRequest.getGroupId());

      IGFolderServiceUtil.addFolder(parentFolderId, name, description, serviceContext);

      String location = StringUtil.merge(pathArray, StringPool.SLASH);

      return new Status(location, HttpServletResponse.SC_CREATED);
    } catch (DuplicateFolderNameException dfne) {
      return new Status(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
    } catch (NoSuchFolderException nsfe) {
      return new Status(HttpServletResponse.SC_CONFLICT);
    } catch (PrincipalException pe) {
      return new Status(HttpServletResponse.SC_FORBIDDEN);
    } catch (Exception e) {
      throw new WebDAVException(e);
    }
  }
Ejemplo n.º 9
0
  public int moveSimpleResource(
      WebDAVRequest webDavRequest, Resource resource, String destination, boolean overwrite)
      throws WebDAVException {

    try {
      String[] destinationArray = WebDAVUtil.getPathArray(destination, true);

      IGImage image = (IGImage) resource.getModel();

      long companyId = webDavRequest.getCompanyId();
      long groupId = WebDAVUtil.getGroupId(companyId, destinationArray);
      long parentFolderId = getParentFolderId(companyId, destinationArray);
      String name = WebDAVUtil.getResourceName(destinationArray);
      String description = image.getDescription();
      File file = null;
      String contentType = null;

      ServiceContext serviceContext = new ServiceContext();

      int status = HttpServletResponse.SC_CREATED;

      if (overwrite) {
        if (deleteResource(groupId, parentFolderId, name)) {
          status = HttpServletResponse.SC_NO_CONTENT;
        }
      }

      IGImageServiceUtil.updateImage(
          image.getImageId(),
          groupId,
          parentFolderId,
          name,
          description,
          file,
          contentType,
          serviceContext);

      return status;
    } catch (PrincipalException pe) {
      return HttpServletResponse.SC_FORBIDDEN;
    } catch (DuplicateFileException dfe) {
      return HttpServletResponse.SC_PRECONDITION_FAILED;
    } catch (DuplicateFolderNameException dfne) {
      return HttpServletResponse.SC_PRECONDITION_FAILED;
    } catch (Exception e) {
      throw new WebDAVException(e);
    }
  }
Ejemplo n.º 10
0
  protected List<Resource> getImages(WebDAVRequest webDavRequest, long parentFolderId)
      throws Exception {

    long groupId = webDavRequest.getGroupId();

    List<Resource> resources = new ArrayList<Resource>();

    List<IGImage> images = IGImageServiceUtil.getImages(groupId, parentFolderId);

    for (IGImage image : images) {
      Resource resource = toResource(webDavRequest, image, true);

      resources.add(resource);
    }

    return resources;
  }
Ejemplo n.º 11
0
  protected List<Resource> getFolders(WebDAVRequest webDavRequest, long parentFolderId)
      throws Exception {

    List<Resource> resources = new ArrayList<Resource>();

    long groupId = webDavRequest.getGroupId();

    List<IGFolder> folders = IGFolderServiceUtil.getFolders(groupId, parentFolderId);

    for (IGFolder folder : folders) {
      Resource resource = toResource(webDavRequest, folder, true);

      resources.add(resource);
    }

    return resources;
  }
Ejemplo n.º 12
0
  public static Resource toResource(
      WebDAVRequest webDAVRequest, String type, String rootPath, boolean appendPath) {

    String parentPath = rootPath + webDAVRequest.getPath();

    String name = StringPool.BLANK;

    if (appendPath) {
      name = type;
    }

    Resource resource = new BaseResourceImpl(parentPath, name, type);

    resource.setModel(type);

    return resource;
  }
  protected List<Resource> getStructures(WebDAVRequest webDAVRequest) throws Exception {

    List<Resource> resources = new ArrayList<>();

    List<DDMStructure> ddmStructures =
        DDMStructureLocalServiceUtil.getStructures(
            webDAVRequest.getGroupId(), PortalUtil.getClassNameId(JournalArticle.class));

    for (DDMStructure ddmStructure : ddmStructures) {
      Resource resource =
          DDMWebDavUtil.toResource(webDAVRequest, ddmStructure, getRootPath(), true);

      resources.add(resource);
    }

    return resources;
  }
Ejemplo n.º 14
0
  protected Resource toResource(WebDAVRequest webDavRequest, IGFolder folder, boolean appendPath) {

    String parentPath = getRootPath() + webDavRequest.getPath();
    String name = StringPool.BLANK;

    if (appendPath) {
      name = folder.getName();
    }

    Resource resource =
        new BaseResourceImpl(
            parentPath, name, folder.getName(), folder.getCreateDate(), folder.getModifiedDate());

    resource.setModel(folder);
    resource.setClassName(IGFolder.class.getName());
    resource.setPrimaryKey(folder.getPrimaryKey());

    return resource;
  }
  protected List<Resource> getTemplates(WebDAVRequest webDAVRequest) throws Exception {

    List<Resource> resources = new ArrayList<>();

    List<DDMTemplate> ddmTemplates =
        DDMTemplateLocalServiceUtil.getTemplatesByStructureClassNameId(
            webDAVRequest.getGroupId(),
            PortalUtil.getClassNameId(JournalArticle.class),
            QueryUtil.ALL_POS,
            QueryUtil.ALL_POS,
            null);

    for (DDMTemplate ddmTemplate : ddmTemplates) {
      Resource resource = DDMWebDavUtil.toResource(webDAVRequest, ddmTemplate, getRootPath(), true);

      resources.add(resource);
    }

    return resources;
  }
  @Override
  public List<Resource> getResources(WebDAVRequest webDAVRequest) throws WebDAVException {

    try {
      String[] pathArray = webDAVRequest.getPathArray();

      if (pathArray.length == 2) {
        return getFolders(webDAVRequest);
      } else if (pathArray.length == 3) {
        String type = pathArray[2];

        if (type.equals(DDMWebDavUtil.TYPE_STRUCTURES)) {
          return getStructures(webDAVRequest);
        } else if (type.equals(DDMWebDavUtil.TYPE_TEMPLATES)) {
          return getTemplates(webDAVRequest);
        }
      }

      return new ArrayList<>();
    } catch (Exception e) {
      throw new WebDAVException(e);
    }
  }
Ejemplo n.º 17
0
  public Resource getResource(WebDAVRequest webDavRequest) throws WebDAVException {

    try {
      String[] pathArray = webDavRequest.getPathArray();

      long companyId = webDavRequest.getCompanyId();
      long parentFolderId = getParentFolderId(companyId, pathArray);
      String name = WebDAVUtil.getResourceName(pathArray);

      if (Validator.isNull(name)) {
        String path = getRootPath() + webDavRequest.getPath();

        return new BaseResourceImpl(path, StringPool.BLANK, getToken());
      }

      try {
        IGFolder folder =
            IGFolderServiceUtil.getFolder(webDavRequest.getGroupId(), parentFolderId, name);

        if ((folder.getParentFolderId() != parentFolderId)
            || (webDavRequest.getGroupId() != folder.getGroupId())) {

          throw new NoSuchFolderException();
        }

        return toResource(webDavRequest, folder, false);
      } catch (NoSuchFolderException nsfe) {
        try {
          long groupId = webDavRequest.getGroupId();

          IGImage image =
              IGImageServiceUtil.getImageByFolderIdAndNameWithExtension(
                  groupId, parentFolderId, name);

          return toResource(webDavRequest, image, false);
        } catch (NoSuchImageException nsie) {
          return null;
        }
      }
    } catch (Exception e) {
      throw new WebDAVException(e);
    }
  }
Ejemplo n.º 18
0
  public int copySimpleResource(
      WebDAVRequest webDavRequest, Resource resource, String destination, boolean overwrite)
      throws WebDAVException {

    File file = null;

    try {
      String[] destinationArray = WebDAVUtil.getPathArray(destination, true);

      long companyId = webDavRequest.getCompanyId();

      long parentFolderId = IGFolderConstants.DEFAULT_PARENT_FOLDER_ID;

      try {
        parentFolderId = getParentFolderId(companyId, destinationArray);
      } catch (NoSuchFolderException nsfe) {
        return HttpServletResponse.SC_CONFLICT;
      }

      IGImage image = (IGImage) resource.getModel();

      long groupId = WebDAVUtil.getGroupId(companyId, destination);
      String name = WebDAVUtil.getResourceName(destinationArray);
      String description = image.getDescription();
      String contentType = MimeTypesUtil.getContentType(image.getNameWithExtension());

      file = FileUtil.createTempFile(image.getImageType());

      InputStream is = resource.getContentAsStream();

      FileUtil.write(file, is);

      ServiceContext serviceContext = new ServiceContext();

      serviceContext.setAddCommunityPermissions(isAddCommunityPermissions(groupId));
      serviceContext.setAddGuestPermissions(true);

      int status = HttpServletResponse.SC_CREATED;

      if (overwrite) {
        if (deleteResource(groupId, parentFolderId, name)) {
          status = HttpServletResponse.SC_NO_CONTENT;
        }
      }

      IGImageServiceUtil.addImage(
          groupId, parentFolderId, name, description, file, contentType, serviceContext);

      return status;
    } catch (DuplicateFolderNameException dfne) {
      return HttpServletResponse.SC_PRECONDITION_FAILED;
    } catch (DuplicateFileException dfe) {
      return HttpServletResponse.SC_PRECONDITION_FAILED;
    } catch (PrincipalException pe) {
      return HttpServletResponse.SC_FORBIDDEN;
    } catch (Exception e) {
      throw new WebDAVException(e);
    } finally {
      if (file != null) {
        file.delete();
      }
    }
  }
Ejemplo n.º 19
0
  public int putResource(WebDAVRequest webDavRequest) throws WebDAVException {
    File file = null;

    try {
      HttpServletRequest request = webDavRequest.getHttpServletRequest();

      String[] pathArray = webDavRequest.getPathArray();

      long companyId = webDavRequest.getCompanyId();
      long groupId = webDavRequest.getGroupId();
      long parentFolderId = getParentFolderId(companyId, pathArray);
      String name = WebDAVUtil.getResourceName(pathArray);
      String description = StringPool.BLANK;

      file = FileUtil.createTempFile(FileUtil.getExtension(name));

      FileUtil.write(file, request.getInputStream());

      String contentType = MimeTypesUtil.getContentType(name);

      ServiceContext serviceContext = new ServiceContext();

      serviceContext.setAddCommunityPermissions(isAddCommunityPermissions(groupId));
      serviceContext.setAddGuestPermissions(true);

      try {
        IGImage image =
            IGImageServiceUtil.getImageByFolderIdAndNameWithExtension(
                groupId, parentFolderId, name);

        long imageId = image.getImageId();

        description = image.getDescription();

        String[] assetTagNames =
            AssetTagLocalServiceUtil.getTagNames(IGImage.class.getName(), imageId);

        serviceContext.setAssetTagNames(assetTagNames);

        IGImageServiceUtil.updateImage(
            imageId, groupId, parentFolderId, name, description, file, contentType, serviceContext);
      } catch (NoSuchImageException nsie) {
        IGImageServiceUtil.addImage(
            groupId, parentFolderId, name, description, file, contentType, serviceContext);
      }

      return HttpServletResponse.SC_CREATED;
    } catch (PrincipalException pe) {
      return HttpServletResponse.SC_FORBIDDEN;
    } catch (PortalException pe) {
      if (_log.isWarnEnabled()) {
        _log.warn(pe, pe);
      }

      return HttpServletResponse.SC_CONFLICT;
    } catch (Exception e) {
      throw new WebDAVException(e);
    } finally {
      if (file != null) {
        file.delete();
      }
    }
  }
  protected int doProcess(WebDAVRequest webDAVRequest) throws Exception {
    WebDAVStorage storage = webDAVRequest.getWebDAVStorage();

    if (!storage.isSupportsClassTwo()) {
      return HttpServletResponse.SC_METHOD_NOT_ALLOWED;
    }

    HttpServletRequest request = webDAVRequest.getHttpServletRequest();
    HttpServletResponse response = webDAVRequest.getHttpServletResponse();

    Lock lock = null;
    Status status = null;

    String lockUuid = webDAVRequest.getLockUuid();
    long timeout = WebDAVUtil.getTimeout(request);

    if (Validator.isNull(lockUuid)) {

      // Create new lock

      String owner = null;
      String xml = new String(FileUtil.getBytes(request.getInputStream()));

      if (Validator.isNotNull(xml)) {
        if (_log.isDebugEnabled()) {
          _log.debug("Request XML\n" + XMLFormatter.toString(xml));
        }

        Document document = SAXReaderUtil.read(xml);

        Element rootElement = document.getRootElement();

        boolean exclusive = false;

        Element lockscopeElement = rootElement.element("lockscope");

        for (Element element : lockscopeElement.elements()) {
          String name = GetterUtil.getString(element.getName());

          if (name.equals("exclusive")) {
            exclusive = true;
          }
        }

        if (!exclusive) {
          return HttpServletResponse.SC_BAD_REQUEST;
        }

        Element ownerElement = rootElement.element("owner");

        owner = ownerElement.getTextTrim();

        if (Validator.isNull(owner)) {
          List<Element> hrefElements = ownerElement.elements("href");

          for (Element hrefElement : hrefElements) {
            owner = "<D:href>" + hrefElement.getTextTrim() + "</D:href>";
          }
        }
      } else {
        _log.error("Empty request XML");

        return HttpServletResponse.SC_PRECONDITION_FAILED;
      }

      status = storage.lockResource(webDAVRequest, owner, timeout);

      lock = (Lock) status.getObject();
    } else {
      try {

        // Refresh existing lock

        lock = storage.refreshResourceLock(webDAVRequest, lockUuid, timeout);

        status = new Status(HttpServletResponse.SC_OK);
      } catch (WebDAVException wde) {
        if (wde.getCause() instanceof NoSuchLockException) {
          return HttpServletResponse.SC_PRECONDITION_FAILED;
        } else {
          throw wde;
        }
      }
    }

    // Return lock details

    if (lock == null) {
      return status.getCode();
    }

    long depth = WebDAVUtil.getDepth(request);

    String xml = getResponseXML(lock, depth);

    if (_log.isDebugEnabled()) {
      _log.debug("Response XML\n" + xml);
    }

    String lockToken = "<" + WebDAVUtil.TOKEN_PREFIX + lock.getUuid() + ">";

    response.setContentType(ContentTypes.TEXT_XML_UTF8);
    response.setHeader("Lock-Token", lockToken);
    response.setStatus(status.getCode());

    if (_log.isDebugEnabled()) {
      _log.debug("Returning lock token " + lockToken);
    }

    try {
      ServletResponseUtil.write(response, xml);
    } catch (Exception e) {
      if (_log.isWarnEnabled()) {
        _log.warn(e);
      }
    }

    return status.getCode();
  }
Ejemplo n.º 21
0
  public static int putResource(
      WebDAVRequest webDAVRequest, String rootPath, String token, long classNameId)
      throws WebDAVException {

    try {
      Resource resource = getResource(webDAVRequest, rootPath, token, classNameId);

      if (resource == null) {
        return addResource(webDAVRequest, classNameId);
      }

      Object model = resource.getModel();

      if (model instanceof DDMStructure) {
        DDMStructure structure = (DDMStructure) model;

        HttpServletRequest request = webDAVRequest.getHttpServletRequest();

        String definition = StringUtil.read(request.getInputStream());

        DDMForm ddmForm = getDDMForm(definition);

        DDMFormLayout ddmFormLayout = DDMUtil.getDefaultDDMFormLayout(ddmForm);

        DDMStructureServiceUtil.updateStructure(
            structure.getGroupId(),
            structure.getParentStructureId(),
            structure.getClassNameId(),
            structure.getStructureKey(),
            structure.getNameMap(),
            structure.getDescriptionMap(),
            ddmForm,
            ddmFormLayout,
            new ServiceContext());

        return HttpServletResponse.SC_CREATED;
      } else if (model instanceof DDMTemplate) {
        DDMTemplate template = (DDMTemplate) model;

        HttpServletRequest request = webDAVRequest.getHttpServletRequest();

        String script = StringUtil.read(request.getInputStream());

        DDMTemplateServiceUtil.updateTemplate(
            template.getTemplateId(),
            template.getClassPK(),
            template.getNameMap(),
            template.getDescriptionMap(),
            template.getType(),
            template.getMode(),
            template.getLanguage(),
            script,
            template.isCacheable(),
            template.isSmallImage(),
            template.getSmallImageURL(),
            null,
            new ServiceContext());

        return HttpServletResponse.SC_CREATED;
      } else {
        return HttpServletResponse.SC_FORBIDDEN;
      }
    } catch (PortalException pe) {
      if (_log.isDebugEnabled()) {
        _log.debug(pe, pe);
      }

      return HttpServletResponse.SC_FORBIDDEN;
    } catch (Exception e) {
      throw new WebDAVException(e);
    }
  }