Files
konradandCursor 300484114f Let a Working Folder delete a basename.
CheckDNS needs that to Remove Domain without a second storage path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 19:31:36 +02:00

26 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# go-nc-files
Shared Go Library for reading and writing a Nextcloud user's files from ExApp Services: a storage seam (local and WebDAV), path hygiene, saved default folder preferences, and visit-scoped folder resolution. Depends on go-nc-exapp for AppAPI credentials on WebDAV. ExApps import `gitea.neitzel.de/konrad/go-nc-files`.
## Language
**User Files Root**:
The root of that Nextcloud user's files tree. Working Folder paths are relative to it (including paths that appear in shares as the user sees them).
_Avoid_: absolute WebDAV URLs, numeric file IDs
**Working Folder**:
The single folder an ExApp uses for the current operation. Its path is relative to the User Files Root. Each ExApp defines what files inside that folder mean; this Library only opens, lists, reads, writes, and removes there.
_Avoid_: catalog folder, zones directory, app-specific suffixes in Library code
**Saved Default**:
The Working Folder path persisted for app-icon launches for that user. Stored via a `DefaultPathStore` implementation (ExApp preferences in production, a JSON file in local/test mode). The ExApp supplies the preference key and initial folder name.
_Avoid_: visit-only path as saved default, admin AppConfig
**Visit**:
One inbound ExApp request bound to one Working Folder. App-icon launch uses the Saved Default (creating the initial folder empty if missing). Files-view launch may pass a User Files Root–relative visit path for that request only; if that folder is missing or forbidden, the Visit fails — no fallback to Saved Default and no implicit create.
_Avoid_: silently switching folders, creating a visit path that was not saved as default
**Files seam**:
The `Root` and `Folder` interfaces: open or ensure a relative path, then list, read, write, remove, and test existence. Local disk and WebDAV are two implementations of the same seam.
_Avoid_: coupling the seam to a specific on-disk layout beyond basename rules