Some adapters support up- and download of files. Not all adapters support this and the individual interactions are different between each of the adapters.
Marvin encodes its file interaction API in a separate typeclass
Adapters can opt to implement this class to support file interactions.
The concrete structure of local and remote files and metadata differs between each adapter.
However the API enforces certain basic rules on the data.
Each adapter may implement additional custom functionality, but if you wish to be adapter agnostic, for instance when implementing a library of reactions, you can rely on the API interface.
Remote files must have
- An optional name, available through the
- An optional url, from which the file can be downloaded, available through the
- An optional file type, available through the
- A creation date, available through the
- and a size, available through the
All optional fields use lenses which return
Content of remote files can be downloaded using
Local files must have
- A name, available through the
- content, which is either in-memory or on-disk, available through the
- and an optional file type, available through the
Local files can be created using the
newLocalFile function and uploaded using
Adapters which support the
HasFiles class can emit the
This event can be handled with the