Skip to content

Commit 51a3e3a

Browse files
committed
add close() to VirtualFileSytem
1 parent 3395bc0 commit 51a3e3a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

graalpython/org.graalvm.python.embedding/src/org/graalvm/python/embedding/utils/VirtualFileSystem.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@
4040
*/
4141
package org.graalvm.python.embedding.utils;
4242

43+
import java.io.IOException;
4344
import java.nio.file.Path;
4445
import java.util.function.Predicate;
4546

46-
public final class VirtualFileSystem {
47+
public final class VirtualFileSystem implements AutoCloseable {
4748

4849
final VirtualFileSystemImpl impl;
4950

@@ -197,4 +198,14 @@ public String getMountPoint() {
197198
return this.impl.mountPoint.toString();
198199
}
199200

201+
/**
202+
* Closes the VirtualFileSystem and frees up potentially allocated resources.
203+
*
204+
* @throws IOException if the resources could not be freed.
205+
*/
206+
@Override
207+
public void close() throws IOException {
208+
impl.close();
209+
}
210+
200211
}

0 commit comments

Comments
 (0)