]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Adding FileSystem and FileSystems to Files SCL-API 50/1650/3
authorjsimomaa <jani.simomaa@gmail.com>
Mon, 26 Mar 2018 05:40:13 +0000 (08:40 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 26 Mar 2018 08:17:27 +0000 (11:17 +0300)
refs #7841

Change-Id: I8b2a02b68c29bb5be724def3e0c2d67b2b6c51e6

bundles/org.simantics.scl.runtime/scl/Files.scl

index 069076fefdd2edaf261e6c62e4a21aa00a15cc6a..d1bc885616e2d34c91c2e633fe2939ece0a6d4e9 100644 (file)
@@ -59,6 +59,25 @@ importJava "java.nio.file.LinkOption" where
 importJava "java.nio.file.attribute.FileAttribute" where
     data FileAttribute
 
 importJava "java.nio.file.attribute.FileAttribute" where
     data FileAttribute
 
+importJava "java.nio.file.FileSystem" where
+    data FileSystem
+    
+    @JavaName close
+    closeFileSystem :: FileSystem -> <Proc> ()
+    
+    @JavaName getPath
+    getPathFromFileSystem :: FileSystem -> String -> Vector String -> <Proc> 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 -> <Proc, Exception> InputStream 
 importJava "java.nio.file.Files" where
     @JavaName newInputStream
     newInputStreamWithOpenOptions :: Path -> Vector OpenOption -> <Proc, Exception> InputStream