wrap stream before closing zip files.

This commit is contained in:
gnembon committed 2021-05-23 14:00:49 -03:00
1 parent fb4c40c951
commit 1b39feaab7
1 file changed
+4 -5
@@ -244,11 +244,10 @@ public class FileArgument
Path rootPath = moduleRootPath(module);
if (rootPath == null) return null;
String zipComponent = (zipContainer != null) ? rootPath.relativize(zipPath).toString() : null;
strings = result.map(p -> {
if (zipContainer == null)
return rootPath.relativize(p).toString().replaceAll("[\\\\/]+", "/");
return (zipComponent + '/'+ p.toString()).replaceAll("[\\\\/]+", "/");
});
strings = (zipContainer == null)
? result.map(p -> rootPath.relativize(p).toString().replaceAll("[\\\\/]+", "/"))
// need to remove ties to the zip file system before closing, so wrapping the stream
: result.map(p -> (zipComponent + '/'+ p.toString()).replaceAll("[\\\\/]+", "/")).collect(Collectors.toList()).stream();
} }
finally
{