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)); }
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); }
public void addProperty(DavContext ctxt, ResourceProperty prop) throws DavException { Element top = mResponse.addElement(DavElements.E_PROP); prop.toElement(ctxt, top, false); }