/** * Add the property names contained in the specified set to this set. * * @param propertyNames * @return true if the set has been modified by this call. */ public boolean addAll(DavPropertyNameSet propertyNames) { return set.addAll(propertyNames.getContent()); }
/** * @see org.apache.jackrabbit.webdav.DavResource#getPropertyNames() */ @Override public DavPropertyName[] getPropertyNames() { initPropertyNames(); return names.getContent().toArray(new DavPropertyName[names.getContentSize()]); }
/** * Remove multiple child as specified by the parameter * @param props PropertyNameSet to remove */ public void removeChildren(DavPropertyNameSet props){ if(children != null && props != null) children.removeAll(props.getContent()); }
private static void assertPropertyNames(DavPropertyNameSet expected, DavPropertyNameSet result) { assertEquals(expected.getContentSize(), result.getContentSize()); if (!(expected.getContent().containsAll(result.getContent()))) { StringBuilder missing = new StringBuilder(); for (DavPropertyName name : expected.getContent()) { if (!result.contains(name)) { missing.append("- ").append(name.toString()).append('\n'); } } fail("Missing properties : \n" + missing); } }
/** * Add collection of Children to property * @param propertyNames Set to add as children */ public void addChildren(DavPropertyNameSet propertyNames){ if(propertyNames == null || propertyNames.isEmpty()) return; children.addAll(propertyNames.getContent()); }
public void setProperties(DavPropertyNameSet properties) { this.properties.addChildren(properties.getContent()); }
Set<DavPropertyName> missing = new HashSet<DavPropertyName>(propNameSet.getContent());
Set<DavPropertyName> missing = new HashSet<DavPropertyName>(propNameSet.getContent());
DavPropertySet getProperties(final URLFileName name, final int type, final DavPropertyNameSet nameSet, final boolean addEncoding) throws FileSystemException { try { final String urlStr = toUrlString(name); final PropFindMethod method = new PropFindMethod(urlStr, type, nameSet, DavConstants.DEPTH_0); setupMethod(method); execute(method); if (method.succeeded()) { final MultiStatus multiStatus = method.getResponseBodyAsMultiStatus(); final MultiStatusResponse response = multiStatus.getResponses()[0]; final DavPropertySet props = response.getProperties(HttpStatus.SC_OK); if (addEncoding) { final DavProperty prop = new DefaultDavProperty(RESPONSE_CHARSET, method.getResponseCharSet()); props.add(prop); } return props; } return new DavPropertySet(); } catch (final FileSystemException fse) { throw fse; } catch (final Exception e) { throw new FileSystemException("vfs.provider.webdav/get-property.error", e, getName(), name, type, nameSet.getContent(), addEncoding); } }
DavPropertySet getProperties(final URLFileName name, final int type, final DavPropertyNameSet nameSet, final boolean addEncoding) throws FileSystemException { try { final String urlStr = toUrlString(name); final PropFindMethod method = new PropFindMethod(urlStr, type, nameSet, DavConstants.DEPTH_0); setupMethod(method); execute(method); if (method.succeeded()) { final MultiStatus multiStatus = method.getResponseBodyAsMultiStatus(); final MultiStatusResponse response = multiStatus.getResponses()[0]; final DavPropertySet props = response.getProperties(HttpStatus.SC_OK); if (addEncoding) { final DavProperty prop = new DefaultDavProperty(RESPONSE_CHARSET, method.getResponseCharSet()); props.add(prop); } return props; } return new DavPropertySet(); } catch (final FileSystemException fse) { throw fse; } catch (final Exception e) { throw new FileSystemException("vfs.provider.webdav/get-property.error", e, getName(), name, type, nameSet.getContent(), addEncoding); } }
DavPropertySet getProperties(final URLFileName name, final int type, final DavPropertyNameSet nameSet, final boolean addEncoding) throws FileSystemException { try { final String urlStr = toUrlString(name); final PropFindMethod method = new PropFindMethod(urlStr, type, nameSet, DavConstants.DEPTH_0); setupMethod(method); execute(method); if (method.succeeded()) { final MultiStatus multiStatus = method.getResponseBodyAsMultiStatus(); final MultiStatusResponse response = multiStatus.getResponses()[0]; final DavPropertySet props = response.getProperties(HttpStatus.SC_OK); if (addEncoding) { final DavProperty prop = new DefaultDavProperty(RESPONSE_CHARSET, method.getResponseCharSet()); props.add(prop); } return props; } return new DavPropertySet(); } catch (final FileSystemException fse) { throw fse; } catch (final Exception e) { throw new FileSystemException("vfs.provider.webdav/get-property.error", e, getName(), name, type, nameSet.getContent(), addEncoding); } }