Class FileInfo

java.lang.Object
uno.anahata.ai.tools.spi.pojos.FileInfo
All Implemented Interfaces:
StatefulResource

public class FileInfo extends Object implements StatefulResource
A POJO that encapsulates file content and metadata for context-aware operations.

This class implements StatefulResource, allowing it to be tracked by the ResourceTracker to maintain an accurate view of the local file system within the conversation context.

Author:
AI
  • Constructor Details

    • FileInfo

      public FileInfo(String path) throws IOException
      Constructs a FileInfo object by reading the file at the specified path.
      Parameters:
      path - The absolute path to the file.
      Throws:
      IOException - if the file cannot be read.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getResourceId

      public String getResourceId()
      Description copied from interface: StatefulResource
      Gets the unique identifier for this resource.

      For files, this is typically the absolute path. For other resources, it could be a URL, a database ID, or any other unique string.

      Specified by:
      getResourceId in interface StatefulResource
      Returns:
      The unique, non-null identifier for the resource.