Whole binary files that belong to an agent conversation, exposed to scripts as services.conversationFileManager. <p> A chart an agent draws has to become a URL before anyone can look at it, and a URL needs somewhere for the bytes to live. They live beside the conversation's other files, which is the only place that makes the access question answer itself: the directory is derived from the conversation and the conversation is resolved against the logged in profile, so a file name belonging to somebody else's conversation names a path that does not exist for this caller. Nothing here takes a directory from a model, and nothing here takes one from a URL. <p> Deliberately separate from {@code ResultSetManager}, which is line-oriented storage for very large text sets and reads only as much of a file as it was asked for. This is the opposite case - a small file that is only ever wanted whole - and mixing the two would give each a method the other's callers must know not to use. <p> Files are held to a size ceiling on the way in, because the thing writing them is generated: a chart specification that asks for a very large image should fail as a chart rather than as disk pressure a week later.
Group: Managers
Methods
maxBytes()
Returns: int
save(String dir, String fileName, byte[] data)
Returns: long
Writes a file into a conversation's directory, replacing any file already there under that name.
| Parameter | Description |
|---|---|
dir | the conversation directory, as resolved by the caller from the conversation itself |
fileName | the file name, letters digits dot dash and underscore only |
data | the bytes to write |
exists(String dir, String fileName)
Returns: boolean
| Parameter | Description |
|---|---|
dir | the conversation directory |
fileName | the file name |
read(String dir, String fileName)
Returns: byte[]
Reads a file back, whole. <p> Whole rather than as a stream because the underlying store closes its handle as soon as the read callback returns, so a stream handed out here would already be closed by the time a caller used it. These files are small by construction - see {@link #MAX_BYTES} - so reading them into memory is the honest implementation rather than a compromise.
| Parameter | Description |
|---|---|
dir | the conversation directory |
fileName | the file name |