storage Service
Storage And Files capability acquired through a declared System Service.
Contract storage · 1.0.0-draft.1
Functions
root
Root Folder.
No Arguments
Returns: storage.Folder
Behavior
- All paths are relative to the configured root. Absolute paths, parent traversal and links escaping that root fail. Generated files belong in System-owned folders, not platform upload or cdn areas.
- get returns an entry or null. File and Folder operations require the corresponding entry kind. newFile is exclusive and fails with Conflict when an entry exists.
- A listing visitor is a named one-argument helper returning no value. Listing order is unspecified.
- read returns up to the requested positive byte count or null at end of stream. Writes accept the documented content type. Explicitly close author-opened streams in finally; scope cleanup is a safety net.
- File metadata, storage handles and file bytes are distinct types. A handle cannot outlive its owning scope or become a serialized business result.