Пример #1
0
 public void toResponse(DavContext ctxt, Element response, boolean nameOnly) {
   if (!mProps.isEmpty()) {
     Element propElem = findProp(HttpServletResponse.SC_OK);
     for (ResourceProperty prop : mProps) prop.toElement(ctxt, propElem, nameOnly);
   }
   for (Integer code : mMap.keySet()) response.add(mMap.get(code));
 }
Пример #2
0
 protected void getMountpointTarget(DavContext ctxt) throws ServiceException {
   ZAuthToken zat = AuthProvider.getAuthToken(ctxt.getAuthAccount()).toZAuthToken();
   ZMailbox zmbx = getRemoteMailbox(zat, mRemoteOwnerId);
   if (zmbx == null) return;
   ZFolder folder = zmbx.getFolder(new ItemId(mRemoteOwnerId, mRemoteId).toString(mOwnerId));
   if (folder == null) return;
   mCtag = CtagInfo.makeCtag(folder);
   setProperty(DavElements.E_GETCTAG, mCtag);
   mRights = ACL.stringToRights(folder.getEffectivePerms());
   addProperty(Acl.getCurrentUserPrivilegeSet(mRights));
   addProperty(Acl.getMountpointTargetPrivilegeSet(mRights));
   String targetUrl =
       UrlNamespace.getResourceUrl(
           Provisioning.getInstance().get(Key.AccountBy.id, mRemoteOwnerId),
           folder.getPath() + "/");
   ResourceProperty mp = new ResourceProperty(DavElements.E_MOUNTPOINT_TARGET_URL);
   mp.addChild(DavElements.E_HREF).setText(targetUrl);
   addProperty(mp);
 }
Пример #3
0
 public void addProperty(DavContext ctxt, ResourceProperty prop) throws DavException {
   Element top = mResponse.addElement(DavElements.E_PROP);
   prop.toElement(ctxt, top, false);
 }