closing the copy stream
@@ -191,10 +191,11 @@ public class NugetPackageController extends BaseArtifactController
ArtifactControllerHelper.setHeadersForChecksums(is, response);
// unfortunately 'new TempNupkgFile(is)' closes 'is' stream :(
- InputStream isCopy = getArtifactManagementService().resolve(storageId, repositoryId, path);
-
+ try (InputStream isCopy = getArtifactManagementService().resolve(storageId, repositoryId, path))
+ {
copyToResponse(isCopy, response);
}
+ }
}
catch (Exception e)
