public SupportedPrivilegeSetProperty(DavProperty<?> p) throws DavException { super(SecurityConstants.SUPPORTED_PRIVILEGE_SET, true); if (!SecurityConstants.SUPPORTED_PRIVILEGE_SET.equals(getName())) { throw new DavException(DavServletResponse.SC_BAD_REQUEST, "DAV:supported-privilege-set expected."); } List<SupportedPrivilege> supportedPrivs = new ArrayList<SupportedPrivilege>(); for (Object obj : Collections.singletonList(p.getValue())) { if (obj instanceof Element) { supportedPrivs.add(SupportedPrivilege.getSupportedPrivilege((Element) obj)); } else if (obj instanceof Collection) { for (Object entry : ((Collection<?>) obj)) { if (entry instanceof Element) { supportedPrivs.add(SupportedPrivilege.getSupportedPrivilege((Element) entry)); } } } } supportedPrivileges = supportedPrivs.toArray(new SupportedPrivilege[supportedPrivs.size()]); }
public SupportedPrivilegeSetProperty(DavProperty<?> p) throws DavException { super(SecurityConstants.SUPPORTED_PRIVILEGE_SET, true); if (!SecurityConstants.SUPPORTED_PRIVILEGE_SET.equals(getName())) { throw new DavException(DavServletResponse.SC_BAD_REQUEST, "DAV:supported-privilege-set expected."); } List<SupportedPrivilege> supportedPrivs = new ArrayList<SupportedPrivilege>(); for (Object obj : Collections.singletonList(p.getValue())) { if (obj instanceof Element) { supportedPrivs.add(SupportedPrivilege.getSupportedPrivilege((Element) obj)); } else if (obj instanceof Collection) { for (Object entry : ((Collection<?>) obj)) { if (entry instanceof Element) { supportedPrivs.add(SupportedPrivilege.getSupportedPrivilege((Element) entry)); } } } } supportedPrivileges = supportedPrivs.toArray(new SupportedPrivilege[supportedPrivs.size()]); }
sp.add(getSupportedPrivilege(child));