java.lang.Object
io.agentscope.harness.agent.sandbox.layout.WorkspaceEntry
io.agentscope.harness.agent.sandbox.layout.FileEntry

public class FileEntry extends WorkspaceEntry
Layout entry that creates a file with inline text content.
  • Constructor Details

    • FileEntry

      public FileEntry()
      Creates an empty file entry.
    • FileEntry

      public FileEntry(String content)
      Creates a file entry with the given content.
      Parameters:
      content - the file content as a string
    • FileEntry

      public FileEntry(String content, String encoding)
      Creates a file entry with the given content and encoding.
      Parameters:
      content - the file content as a string
      encoding - the character encoding to use when writing the file
  • Method Details

    • getContent

      public String getContent()
      Returns the file content.
      Returns:
      file content string
    • setContent

      public void setContent(String content)
      Sets the file content.
      Parameters:
      content - the file content string
    • getEncoding

      public String getEncoding()
      Returns the character encoding used to write this file.
      Returns:
      encoding name (e.g. "UTF-8")
    • setEncoding

      public void setEncoding(String encoding)
      Sets the character encoding used to write this file.
      Parameters:
      encoding - encoding name (e.g. "UTF-8")