Class Filesystem
java.lang.Object
io.agentscope.extensions.sandbox.kubernetes.client.Filesystem
File operations inside a sandbox via the runtime HTTP API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether a path exists in the sandbox.booleanChecks whether a path exists in the sandbox.Lists entries in a directory.Lists entries in a directory.byte[]Reads a file from the sandbox.byte[]Reads a file from the sandbox.voidWrites content to a file in the sandbox.voidWrites content to a file in the sandbox.voidWrites string content (UTF-8) to a file in the sandbox.
-
Constructor Details
-
Filesystem
-
-
Method Details
-
write
Writes content to a file in the sandbox.- Parameters:
path- relative destination pathcontent- file bytes
-
write
Writes content to a file in the sandbox.- Parameters:
path- destination pathcontent- file bytestimeout- request timeoutallowUnsafePaths- when false, rejects absolute paths and..
-
write
Writes string content (UTF-8) to a file in the sandbox.- Parameters:
path- relative destination pathcontent- text content
-
read
Reads a file from the sandbox.- Parameters:
path- file path- Returns:
- file bytes
-
read
Reads a file from the sandbox.- Parameters:
path- file pathtimeout- request timeoutallowUnsafePaths- when false, rejects absolute paths and..- Returns:
- file bytes
-
list
Lists entries in a directory.- Parameters:
path- directory path- Returns:
- file entries
-
list
Lists entries in a directory.- Parameters:
path- directory pathtimeout- request timeout- Returns:
- file entries
-
exists
Checks whether a path exists in the sandbox.- Parameters:
path- path to check- Returns:
- true if exists
-
exists
Checks whether a path exists in the sandbox.- Parameters:
path- path to checktimeout- request timeout- Returns:
- true if exists
-