Class FileEntry
java.lang.Object
io.agentscope.harness.agent.sandbox.layout.WorkspaceEntry
io.agentscope.harness.agent.sandbox.layout.FileEntry
Layout entry that creates a file with inline text content.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the file content.Returns the character encoding used to write this file.voidsetContent(String content) Sets the file content.voidsetEncoding(String encoding) Sets the character encoding used to write this file.Methods inherited from class io.agentscope.harness.agent.sandbox.layout.WorkspaceEntry
isEphemeral, setEphemeral
-
Constructor Details
-
FileEntry
public FileEntry()Creates an empty file entry. -
FileEntry
Creates a file entry with the given content.- Parameters:
content- the file content as a string
-
FileEntry
Creates a file entry with the given content and encoding.- Parameters:
content- the file content as a stringencoding- the character encoding to use when writing the file
-
-
Method Details
-
getContent
Returns the file content.- Returns:
- file content string
-
setContent
Sets the file content.- Parameters:
content- the file content string
-
getEncoding
Returns the character encoding used to write this file.- Returns:
- encoding name (e.g. "UTF-8")
-
setEncoding
Sets the character encoding used to write this file.- Parameters:
encoding- encoding name (e.g. "UTF-8")
-