aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2020-07-07 23:57:59 +0200
committerMartin Stockhammer <martin_s@apache.org>2020-07-07 23:57:59 +0200
commit21f02d4e81438b97d13966fb22f825b2249aa8af (patch)
tree42931e0b7994f076b796bd5afda25e730dcf81ed /archiva-modules/archiva-base
parentdcf4c111e57a5a996869918667b1566b0bbe8d46 (diff)
downloadarchiva-21f02d4e81438b97d13966fb22f825b2249aa8af.tar.gz
archiva-21f02d4e81438b97d13966fb22f825b2249aa8af.zip
Fixing closable stream
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r--archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java b/archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java
index fa637c669..bd52e4b6d 100644
--- a/archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java
+++ b/archiva-modules/archiva-base/archiva-storage-api/src/main/java/org/apache/archiva/repository/storage/util/StorageUtil.java
@@ -90,7 +90,8 @@ public class StorageUtil
*/
public static Stream<StorageAsset> newAssetStream( StorageAsset start, boolean parallel )
{
- return StreamSupport.stream( new AssetSpliterator( start ), parallel );
+ final AssetSpliterator spliterator = new AssetSpliterator( start );
+ return StreamSupport.stream( spliterator, parallel ).onClose( ( ) -> spliterator.close( ) );
}