Class FileContent
java.lang.Object
com.alibaba.dashscope.applications.agentstudio.resource.FileContent
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()The raw file bytes.intlength()Number of bytes.writeToFile(String path) Write the content topath(creating parent directories) and return it.writeToFile(Path path) Write the content topath(creating parent directories) and return it.
-
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
Write the content topath(creating parent directories) and return it.- Throws:
IOException
-
writeToFile
Write the content topath(creating parent directories) and return it.- Throws:
IOException
-