From d9856d2391ee17f815a43dad74d9dc6318a1878c Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Mon, 26 Mar 2018 08:40:13 +0300 Subject: [PATCH] Adding FileSystem and FileSystems to Files SCL-API refs #7841 Change-Id: I8b2a02b68c29bb5be724def3e0c2d67b2b6c51e6 --- .../org.simantics.scl.runtime/scl/Files.scl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bundles/org.simantics.scl.runtime/scl/Files.scl b/bundles/org.simantics.scl.runtime/scl/Files.scl index 069076fef..d1bc88561 100644 --- a/bundles/org.simantics.scl.runtime/scl/Files.scl +++ b/bundles/org.simantics.scl.runtime/scl/Files.scl @@ -59,6 +59,25 @@ importJava "java.nio.file.LinkOption" where importJava "java.nio.file.attribute.FileAttribute" where data FileAttribute +importJava "java.nio.file.FileSystem" where + data FileSystem + + @JavaName close + closeFileSystem :: FileSystem -> () + + @JavaName getPath + getPathFromFileSystem :: FileSystem -> String -> Vector String -> Path + +importJava "java.lang.ClassLoader" where + @private + data ClassLoader + +importJava "java.nio.file.FileSystems" where + @private + newFileSystem :: Path -> Maybe ClassLoader -> FileSystem + +newFileSystemFromPath path = newFileSystem path Nothing + importJava "java.nio.file.Files" where @JavaName newInputStream newInputStreamWithOpenOptions :: Path -> Vector OpenOption -> InputStream -- 2.43.2