Skip to content

Commit 5beea99

Browse files
committed
Add PathMaskChecker on list in group level
1 parent c17f7ea commit 5beea99

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

core/src/main/java/org/commonjava/indy/core/content/DefaultDownloadManager.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,31 @@ public List<StoreResource> list( final ArtifactStore store, final String path, f
179179
{
180180
try
181181
{
182-
final List<ListingResult> results = transfers.listAll(
183-
locationExpander.expand( new VirtualResource( LocationUtils.toLocations( store ), path ) ), eventMetadata );
182+
List<ArtifactStore> members;
183+
try
184+
{
185+
members = storeManager.query()
186+
.enabledState( true )
187+
.getOrderedConcreteStoresInGroup( store.getPackageType(), store.getName() );
188+
}
189+
catch ( final IndyDataException e )
190+
{
191+
throw new IndyWorkflowException( "Failed to lookup concrete members of: %s. Reason: %s", e, store,
192+
e.getMessage() );
193+
}
194+
195+
final List<ConcreteResource> concreteResources = new ArrayList<ConcreteResource>();
196+
197+
for ( ArtifactStore member : members )
198+
{
199+
if ( ! PathMaskChecker.checkListingMask( member, path ) )
200+
{
201+
continue;
202+
}
203+
concreteResources.add(new ConcreteResource( LocationUtils.toLocation( member ), path ));
204+
}
205+
206+
final List<ListingResult> results = transfers.listAll( new VirtualResource( concreteResources ), eventMetadata );
184207

185208
for ( final ListingResult lr : results )
186209
{

0 commit comments

Comments
 (0)