org.apache.jackrabbit.webdav.DavResourceIterator Java Examples
The following examples show how to use
org.apache.jackrabbit.webdav.DavResourceIterator.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ArchivaDavResource.java From archiva with Apache License 2.0 | 6 votes |
@Override public DavResourceIterator getMembers() { List<DavResource> list; if ( exists() && isCollection() ) { list = asset.list().stream().filter( m -> !m.getName().startsWith( HIDDEN_PATH_PREFIX ) ) .map(m -> { String path = locator.getResourcePath( ) + '/' + m.getName(); DavResourceLocator resourceLocator = locator.getFactory( ).createResourceLocator( locator.getPrefix( ), path ); try { return factory.createResource( resourceLocator, session ); } catch ( DavException e ) { return null; } }).filter( Objects::nonNull ).collect( Collectors.toList()); } else { list = Collections.emptyList( ); } return new DavResourceIteratorImpl( list ); }
Example #2
Source File: PrincipalPropertySearchReport.java From cosmo with Apache License 2.0 | 6 votes |
/** * Tests every principal member of the collection to see if it matches * the report's search specs. */ protected void doQueryChildren(DavCollection collection) throws CosmoDavException { for (DavResourceIterator i = collection.getMembers(); i.hasNext();) { WebDavResource member = (WebDavResource) i.nextResource(); if (member instanceof DavUserPrincipal) { if (LOG.isDebugEnabled()) { LOG.debug("Testing {}" , member.getResourcePath()); } if (matchPrincipal((DavUserPrincipal)member)) { if (LOG.isDebugEnabled()) { LOG.debug("Matched {}", member.getResourcePath()); } getResults().add(member); } } } }
Example #3
Source File: ReportBase.java From cosmo with Apache License 2.0 | 6 votes |
/** * Performs the report query on the descendents of the specified collection. * Should recursively call the method against each of the children of the * provided collection that are themselves collections. */ protected void doQueryDescendents(DavCollection collection) throws CosmoDavException { if (LOG.isDebugEnabled()) { LOG.debug("Querying descendents of {}", collection.getResourcePath()); } for (DavResourceIterator i = collection.getCollectionMembers(); i.hasNext(); ) { WebDavResource member = (WebDavResource) i.nextResource(); if (member.isCollection()) { DavCollection dc = (DavCollection) member; doQuerySelf(dc); doQueryChildren(dc); doQueryDescendents(dc); } } }
Example #4
Source File: DavHomeCollection.java From cosmo with Apache License 2.0 | 6 votes |
@Override public DavResourceIterator getCollectionMembers() { List<org.apache.jackrabbit.webdav.DavResource> members = new ArrayList<org.apache.jackrabbit.webdav.DavResource>(); try { Set<CollectionItem> collectionItems = getContentService().findCollectionItems((CollectionItem) getItem()); for (Item memberItem : collectionItems) { WebDavResource resource = memberToResource(memberItem); if (resource != null) { members.add(resource); } } // for now scheduling is an option if (isSchedulingEnabled()) { members.add(memberToResource( TEMPLATE_USER_INBOX.bindAbsolute(getResourceLocator().getBaseHref(), getResourcePath()))); members.add(memberToResource( TEMPLATE_USER_OUTBOX.bindAbsolute(getResourceLocator().getBaseHref(), getResourcePath()))); } } catch (CosmoDavException e) { throw new CosmoException(e); } return new DavResourceIteratorImpl(members); }
Example #5
Source File: DavUserPrincipal.java From cosmo with Apache License 2.0 | 5 votes |
public DavResourceIterator getMembers() { /* * While it would be ideal to throw an UnsupportedOperationException, MultiStatus tries to add a * MultiStatusResponse for every member of a WebDavResource regardless of whether or not it's a collection, so * we need to return an empty iterator. */ return new DavResourceIteratorImpl(Collections.emptyList()); }
Example #6
Source File: PrincipalMatchReport.java From cosmo with Apache License 2.0 | 5 votes |
protected void doQueryChildren(DavCollection collection) throws CosmoDavException { for (DavResourceIterator i = collection.getMembers(); i.hasNext();) { WebDavResource member = (WebDavResource) i.nextResource(); if (member.isCollection()) { DavCollection dc = (DavCollection) member; doQuerySelf(dc); doQueryChildren(dc); } else { doQuerySelf(member); } } }
Example #7
Source File: DavInboxCollection.java From cosmo with Apache License 2.0 | 5 votes |
public DavResourceIterator getMembers() { // while it would be ideal to throw an UnsupportedOperationException, // MultiStatus tries to add a MultiStatusResponse for every member // of a WebDavResource regardless of whether or not it's a collection, // so we need to return an empty iterator. return DavResourceIteratorImpl.EMPTY; }
Example #8
Source File: DavContentBase.java From cosmo with Apache License 2.0 | 5 votes |
public DavResourceIterator getMembers() { // while it would be ideal to throw an UnsupportedOperationException, // MultiStatus tries to add a MultiStatusResponse for every member // of a WebDavResource regardless of whether or not it's a collection, // so we need to return an empty iterator. return new DavResourceIteratorImpl(new ArrayList<DavResource>()); }
Example #9
Source File: DavHomeCollection.java From cosmo with Apache License 2.0 | 5 votes |
@Override public DavResourceIterator getMembers() { List<org.apache.jackrabbit.webdav.DavResource> members = new ArrayList<org.apache.jackrabbit.webdav.DavResource>(); try { for (Item memberItem : ((CollectionItem) getItem()).getChildren()) { WebDavResource resource = memberToResource(memberItem); if (resource != null) { members.add(resource); } } // for now scheduling is an option if (isSchedulingEnabled()) { members.add(memberToResource( TEMPLATE_USER_INBOX.bindAbsolute(getResourceLocator().getBaseHref(), getResourcePath()))); members.add(memberToResource( TEMPLATE_USER_OUTBOX.bindAbsolute(getResourceLocator().getBaseHref(), getResourcePath()))); } if (LOG.isTraceEnabled()) { LOG.trace("Members of Home Collection: {}", members.toString()); } return new DavResourceIteratorImpl(members); } catch (CosmoDavException e) { throw new CosmoException(e); } }
Example #10
Source File: DavCollectionBase.java From cosmo with Apache License 2.0 | 5 votes |
public DavResourceIterator getMembers() { try { for (Item memberItem : ((CollectionItem) getItem()).getChildren()) { WebDavResource resource = memberToResource(memberItem); if (resource != null) { members.add(resource); } } return new DavResourceIteratorImpl(members); } catch (CosmoDavException e) { throw new CosmoException(e); } }
Example #11
Source File: DavCollectionBase.java From cosmo with Apache License 2.0 | 5 votes |
public DavResourceIterator getCollectionMembers() { try { Set<CollectionItem> collectionItems = getContentService().findCollectionItems((CollectionItem) getItem()); for (Item memberItem : collectionItems) { WebDavResource resource = memberToResource(memberItem); if (resource != null) { members.add(resource); } } return new DavResourceIteratorImpl(members); } catch (CosmoDavException e) { throw new CosmoException(e); } }
Example #12
Source File: DavOutboxCollection.java From cosmo with Apache License 2.0 | 4 votes |
public DavResourceIterator getMembers() { return DavResourceIteratorImpl.EMPTY; }
Example #13
Source File: ArchivaVirtualDavResource.java From archiva with Apache License 2.0 | 4 votes |
@Override public DavResourceIterator getMembers() { return null; }
Example #14
Source File: DavInboxCollection.java From cosmo with Apache License 2.0 | 4 votes |
@Override public DavResourceIterator getCollectionMembers() { return DavResourceIteratorImpl.EMPTY; }
Example #15
Source File: DavOutboxCollection.java From cosmo with Apache License 2.0 | 4 votes |
@Override public DavResourceIterator getCollectionMembers() { return DavResourceIteratorImpl.EMPTY; }
Example #16
Source File: VersionHistoryResourceImpl.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
@SuppressWarnings("rawtypes") public DavResourceIterator getMembers() { ArrayList list = new ArrayList(); return new DavResourceIteratorImpl(list); }
Example #17
Source File: DavUserPrincipalCollection.java From cosmo with Apache License 2.0 | 4 votes |
@Override public DavResourceIterator getCollectionMembers() { throw new UnsupportedOperationException(); }
Example #18
Source File: DavUserPrincipalCollection.java From cosmo with Apache License 2.0 | 4 votes |
public DavResourceIterator getMembers() { // Return an empty list to also support PROPFIND with depth 1 and depth infinity. return new DavResourceIteratorImpl(Collections.emptyList()); }
Example #19
Source File: VersionResourceImpl.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
public DavResourceIterator getMembers() { return new DavResourceIteratorImpl(Collections.EMPTY_LIST); }
Example #20
Source File: DavCollection.java From cosmo with Apache License 2.0 | 2 votes |
/** * Returns an iterator over all internal members which are themselves collection. * * @return a {@link DavResourceIterator} over all internal members. */ DavResourceIterator getCollectionMembers();