/** */ protected void removeLiveProperty(DavPropertyName name, boolean create) throws CosmoDavException { super.removeLiveProperty(name); ContentItem content = (ContentItem) getItem(); if (content == null) { return; } if (name.equals(DavPropertyName.GETCONTENTLENGTH) || name.equals(DavPropertyName.GETCONTENTTYPE)) { throw new ProtectedPropertyModificationException(name); } }
/** */ protected void removeLiveProperty(DavPropertyName name, boolean create) throws CosmoDavException { super.removeLiveProperty(name); ContentItem content = (ContentItem) getItem(); if (content == null) { return; } if (name.equals(DavPropertyName.GETCONTENTLENGTH) || name.equals(DavPropertyName.GETCONTENTTYPE)) { throw new ProtectedPropertyModificationException(name); } }
/** * @param property Property containing the {@link CalDAVConstants#ELEM_GETETAG} * @return Returns the ETag from the specified Property, null otherwise. */ public static String getEtagfromProperty(DavProperty property){ if(property == null || property.getValue() == null || !property.getName().equals(DavPropertyName.GETETAG)) return null; return property.getValue().toString(); } }
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()]); }
/** */ protected void setLiveProperty(WebDavProperty property, boolean create) throws CosmoDavException { super.setLiveProperty(property, create); DavPropertyName name = property.getName(); if (name.equals(DavPropertyName.GETCONTENTTYPE)) { throw new ProtectedPropertyModificationException(name); } } }
/** */ protected void removeLiveProperty(DavPropertyName name) throws CosmoDavException { super.removeLiveProperty(name); FileItem content = (FileItem) getItem(); if (content == null) { return; } if (name.equals(DavPropertyName.GETCONTENTLANGUAGE)) { content.setContentLanguage(null); return; } }
/** */ protected void removeLiveProperty(DavPropertyName name) throws CosmoDavException { super.removeLiveProperty(name); CollectionItem cc = (CollectionItem) getItem(); if (cc == null) { return; } if (name.equals(EXCLUDEFREEBUSYROLLUP)) { cc.setExcludeFreeBusyRollup(false); } }
private void checkPropertyName(DavPropertyName reqName) throws ValueFormatException { if (!reqName.equals(getName())) { throw new ValueFormatException("Attempt to retrieve multiple values from single property '" + getName() + "'."); } }
/** */ protected void setLiveProperty(WebDavProperty property, boolean create) throws CosmoDavException { super.setLiveProperty(property, create); DavPropertyName name = property.getName(); if (name.equals(DavPropertyName.GETCONTENTTYPE)) { throw new ProtectedPropertyModificationException(name); } } }
/** */ protected void removeLiveProperty(DavPropertyName name) throws CosmoDavException { super.removeLiveProperty(name); CollectionItem cc = (CollectionItem) getItem(); if (cc == null) { return; } if (name.equals(EXCLUDEFREEBUSYROLLUP)) { cc.setExcludeFreeBusyRollup(false); } }
/** */ protected void removeLiveProperty(DavPropertyName name) throws CosmoDavException { super.removeLiveProperty(name); FileItem content = (FileItem) getItem(); if (content == null) { return; } if (name.equals(DavPropertyName.GETCONTENTLANGUAGE)) { content.setContentLanguage(null); return; } }
public boolean equals(Object obj) { if (! (obj instanceof WebDavProperty)) { return false; } WebDavProperty prop = (WebDavProperty) obj; if (! getName().equals(prop.getName())) { return false; } return getValue() == null ? prop.getValue() == null : value.equals(prop.getValue()); }
public boolean equals(Object obj) { if (! (obj instanceof WebDavProperty)) { return false; } WebDavProperty prop = (WebDavProperty) obj; if (! getName().equals(prop.getName())) { return false; } return getValue() == null ? prop.getValue() == null : value.equals(prop.getValue()); }
@Override public DavProperty<?> getProperty(DavPropertyName name) { DavProperty prop = super.getProperty(name); if (prop == null) { try { if (SecurityConstants.SUPPORTED_PRIVILEGE_SET.equals(name)) { prop = new JcrSupportedPrivilegesProperty(getRepositorySession()).asDavProperty(); } } catch (RepositoryException e) { log.error("Failed to build SupportedPrivilegeSet property: " + e.getMessage()); } } return prop; }
/** */ protected void setLiveProperty(WebDavProperty property, boolean create) throws CosmoDavException { super.setLiveProperty(property, create); ContentItem content = (ContentItem) getItem(); if (content == null) { return; } DavPropertyName name = property.getName(); if (name.equals(DavPropertyName.GETCONTENTLENGTH)) { throw new ProtectedPropertyModificationException(name); } // content type is settable by subclasses }
/** */ protected void setLiveProperty(WebDavProperty property, boolean create) throws CosmoDavException { super.setLiveProperty(property, create); ContentItem content = (ContentItem) getItem(); if (content == null) { return; } DavPropertyName name = property.getName(); if (name.equals(DavPropertyName.GETCONTENTLENGTH)) { throw new ProtectedPropertyModificationException(name); } // content type is settable by subclasses }
/** * Calls {@link #removeLiveProperty(DavPropertyName)} or {@link removeDeadProperty(DavPropertyName)}. */ protected void removeResourceProperty(DavPropertyName name) throws CosmoDavException { if (name.equals(SUPPORTEDREPORTSET)) { throw new ProtectedPropertyModificationException(name); } if (isLiveProperty(name)) { removeLiveProperty(name); } else { removeDeadProperty(name); } properties.remove(name); }
/** * Calls {@link #removeLiveProperty(DavPropertyName)} or {@link removeDeadProperty(DavPropertyName)}. */ protected void removeResourceProperty(DavPropertyName name) throws CosmoDavException { if (name.equals(SUPPORTEDREPORTSET)) { throw new ProtectedPropertyModificationException(name); } if (isLiveProperty(name)) { removeLiveProperty(name); } else { removeDeadProperty(name); } properties.remove(name); }
/** * Calls {@link #setLiveProperty(WebDavProperty)} or {@link setDeadProperty(WebDavProperty)}. */ protected void setResourceProperty(WebDavProperty property, boolean create) throws CosmoDavException { DavPropertyName name = property.getName(); if (name.equals(SUPPORTEDREPORTSET)) { throw new ProtectedPropertyModificationException(name); } if (isLiveProperty(property.getName())) { setLiveProperty(property, create); } else { setDeadProperty(property); } properties.add(property); }
/** * Calls {@link #setLiveProperty(WebDavProperty)} or {@link setDeadProperty(WebDavProperty)}. */ protected void setResourceProperty(WebDavProperty property, boolean create) throws CosmoDavException { DavPropertyName name = property.getName(); if (name.equals(SUPPORTEDREPORTSET)) { throw new ProtectedPropertyModificationException(name); } if (isLiveProperty(property.getName())) { setLiveProperty(property, create); } else { setDeadProperty(property); } properties.add(property); }