mirror of https://github.com/apache/archiva.git
Fixing closable stream
This commit is contained in:
parent
dcf4c111e5
commit
21f02d4e81
|
@ -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( ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue