java.lang.Object
com.alibaba.dashscope.applications.agentstudio.resource.FileContent

public final class FileContent extends Object
Binary content of a downloaded file.

Mirrors the Python SDK's FileContent: a thin wrapper over the raw bytes with a writeToFile(Path) helper, so callers can do client.files().download(fileId).writeToFile("output.txt").

  • Constructor Details

    • FileContent

      public FileContent(byte[] data)
  • Method Details

    • getBytes

      public byte[] getBytes()
      The raw file bytes.
    • length

      public int length()
      Number of bytes.
    • writeToFile

      public Path writeToFile(String path) throws IOException
      Write the content to path (creating parent directories) and return it.
      Throws:
      IOException
    • writeToFile

      public Path writeToFile(Path path) throws IOException
      Write the content to path (creating parent directories) and return it.
      Throws:
      IOException