fixed changed behaviour under java 16

This commit is contained in:
gnembon committed 2021-05-13 01:51:01 -03:00
1 parent 495a22ca0c
commit a522e2ae37
1 file changed
+2 -7
@@ -1,8 +1,6 @@
package carpet.script.argument; package carpet.script.argument;
import carpet.CarpetServer; import carpet.CarpetServer;
import carpet.script.Context;
import carpet.script.LazyValue;
import carpet.script.bundled.Module; import carpet.script.bundled.Module;
import carpet.script.exception.InternalExpressionException; import carpet.script.exception.InternalExpressionException;
import carpet.script.exception.ThrowStatement; import carpet.script.exception.ThrowStatement;
@@ -180,14 +178,11 @@ public class FileArgument
Map<String, String> env = new HashMap<>(); Map<String, String> env = new HashMap<>();
if (reason == Reason.CREATE) env.put("create", "true"); if (reason == Reason.CREATE) env.put("create", "true");
zipPath = resolve(getDescriptor(module, zipContainer)); zipPath = resolve(getDescriptor(module, zipContainer));
if (!Files.exists(zipPath) && reason != Reason.CREATE) return null; // no zip file
try { try {
zfs = FileSystems.newFileSystem(URI.create("jar:"+ zipPath.toUri().toString()), env); zfs = FileSystems.newFileSystem(URI.create("jar:"+ zipPath.toUri().toString()), env);
} }
catch (FileSystemNotFoundException fsnfe) catch (FileSystemNotFoundException | IOException fsnfe)
{
return null;
}
catch (IOException e)
{ {
throw new ThrowStatement("Unable to open zip file: "+zipContainer, Throwables.IO_EXCEPTION); throw new ThrowStatement("Unable to open zip file: "+zipContainer, Throwables.IO_EXCEPTION);
} }