Ticket #884 (closed Enhancement: fixed)
Files API: support user with constructing repository paths
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.8 |
Component: | DeepaMehta Standard Distribution | Version: | 4.7 |
Keywords: | Cc: | dgf, Malte | |
Complexity: | 3 | Area: | Application Framework / API |
Module: | deepamehta-files |
Description (last modified by jri) (diff)
In conjunction with the per-workspace file repos feature (#815) the API user needs support with constructing repository paths. In particular the developer should not be required to inspect the per-workspace config value and the workspace cookie.
This could be done by adding this method to the Files service:
String pathPrefix()
This method returns the prefix the developer can use when constructing a repository path. In case of per-workspace file repos are activated the prefix represents the current workspace (e.g. "/workspace-1234", based on the workspace cookie). In case of per-workspace file repos are NOT activated an empty string is returned. The plugin will work in both cases then: with or without per-workspace file repos.
Another method should be added:
boolean fileExists(String repoPath)
It checks if a file/directory exists in the file repo. Currently this is possible only with getFile(String repoPath) but this method expects the file/directory to exist, and otherwise throws a FileRepositoryException with a 404 status code.
Thank you, Malte, for revealing these needs!