Skip to content

Commit c6eac6b

Browse files
committed
hid VFS FileSystem implementation in package private
1 parent dd2e936 commit c6eac6b

File tree

3 files changed

+992
-930
lines changed

3 files changed

+992
-930
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,17 @@ public static Context.Builder contextBuilder() {
255255
public static Context.Builder contextBuilder(VirtualFileSystem vfs) {
256256
return createContextBuilder().
257257
// allow access to the virtual and the host filesystem, as well as sockets
258-
allowIO(IOAccess.newBuilder().allowHostSocketAccess(true).fileSystem(vfs).build()).
258+
allowIO(IOAccess.newBuilder().allowHostSocketAccess(true).fileSystem(vfs.impl).build()).
259259
// The sys.executable path, a virtual path that is used by the interpreter
260260
// to discover packages
261-
option("python.Executable", vfs.vfsVenvPath() + (VirtualFileSystem.isWindows() ? "\\Scripts\\python.exe" : "/bin/python")).
261+
option("python.Executable", vfs.impl.vfsVenvPath() + (VirtualFileSystemImpl.isWindows() ? "\\Scripts\\python.exe" : "/bin/python")).
262262
// Set the python home to be read from the embedded resources
263-
option("python.PythonHome", vfs.vfsHomePath()).
263+
option("python.PythonHome", vfs.impl.vfsHomePath()).
264264
// Set python path to point to sources stored in
265265
// src/main/resources/org.graalvm.python.vfs/src
266-
option("python.PythonPath", vfs.vfsSrcPath()).
266+
option("python.PythonPath", vfs.impl.vfsSrcPath()).
267267
// pass the path to be executed
268-
option("python.InputFilePath", vfs.vfsSrcPath());
268+
option("python.InputFilePath", vfs.impl.vfsSrcPath());
269269
}
270270

271271
/**
@@ -311,14 +311,14 @@ public static Context.Builder contextBuilder(VirtualFileSystem vfs) {
311311
*/
312312
public static Context.Builder contextBuilder(Path resourcesDirectory) {
313313
String execPath;
314-
if (VirtualFileSystem.isWindows()) {
315-
execPath = resourcesDirectory.resolve(VirtualFileSystem.VFS_VENV).resolve("Scripts").resolve("python.exe").toAbsolutePath().toString();
314+
if (VirtualFileSystemImpl.isWindows()) {
315+
execPath = resourcesDirectory.resolve(VirtualFileSystemImpl.VFS_VENV).resolve("Scripts").resolve("python.exe").toAbsolutePath().toString();
316316
} else {
317-
execPath = resourcesDirectory.resolve(VirtualFileSystem.VFS_VENV).resolve("bin").resolve("python").toAbsolutePath().toString();
317+
execPath = resourcesDirectory.resolve(VirtualFileSystemImpl.VFS_VENV).resolve("bin").resolve("python").toAbsolutePath().toString();
318318
}
319319

320-
String homePath = resourcesDirectory.resolve(VirtualFileSystem.VFS_HOME).toAbsolutePath().toString();
321-
String srcPath = resourcesDirectory.resolve(VirtualFileSystem.VFS_SRC).toAbsolutePath().toString();
320+
String homePath = resourcesDirectory.resolve(VirtualFileSystemImpl.VFS_HOME).toAbsolutePath().toString();
321+
String srcPath = resourcesDirectory.resolve(VirtualFileSystemImpl.VFS_SRC).toAbsolutePath().toString();
322322
return createContextBuilder().
323323
// allow all IO access
324324
allowIO(IOAccess.ALL).
@@ -426,6 +426,6 @@ public static void extractVirtualFileSystemResources(VirtualFileSystem vfs, Path
426426
if (Files.exists(resourcesDirectory) && !Files.isDirectory(resourcesDirectory)) {
427427
throw new IOException(String.format("%s has to be a directory", resourcesDirectory.toString()));
428428
}
429-
vfs.extractResources(resourcesDirectory);
429+
vfs.impl.extractResources(resourcesDirectory);
430430
}
431431
}

0 commit comments

Comments
 (0)