diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-07-07 23:57:59 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-07-07 23:57:59 +0200 |
commit | 21f02d4e81438b97d13966fb22f825b2249aa8af (patch) | |
tree | 42931e0b7994f076b796bd5afda25e730dcf81ed /archiva-modules/archiva-base | |
parent | dcf4c111e57a5a996869918667b1566b0bbe8d46 (diff) | |
download | archiva-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.java | 3 |
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( ) ); } |