use of com.zimbra.cs.dav.property.ResourceProperty in project zm-mailbox by Zimbra.
the class RemoteCollection method getMountpointTarget.
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);
}
use of com.zimbra.cs.dav.property.ResourceProperty in project zm-mailbox by Zimbra.
the class DavResource method getPropertiesAsText.
protected String getPropertiesAsText(DavContext ctxt) throws IOException {
Element e = org.dom4j.DocumentHelper.createElement(DavElements.E_PROP);
for (ResourceProperty rp : mProps.values()) rp.toElement(ctxt, e, false);
OutputFormat format = OutputFormat.createPrettyPrint();
format.setTrimText(false);
format.setOmitEncoding(false);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLWriter writer = new XMLWriter(baos, format);
writer.write(e);
return new String(baos.toByteArray());
}
Aggregations