]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.runtime/scl/Files.scl
Adding FileSystem and FileSystems to Files SCL-API
[simantics/platform.git] / 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