A FileRepo is the primary and example implementation of a repository based on a file system. It maintains its files in a bsn/bsn-version.jar style from a given location. It implements all the functions of the {@link RepositoryPlugin}, {@link Refreshable}, {@link Actionable}, and {@link Closeable}. The FileRepo can be extended or used as is. When used as is, it is possible to add shell commands to the life cycle of the FileRepo. This life cycle is as follows:
- {@link #CMD_INIT} - Is only executed when the location did not exist
- {@link #CMD_OPEN} - Called (after init if necessary) to open it once
- {@link #CMD_REFRESH} - Called when refreshed.
- {@link #CMD_BEFORE_PUT} - Before the file system is changed
- {@link #CMD_AFTER_PUT} - After the file system has changed, and the put
- {@link #CMD_BEFORE_GET} - Before the file is gotten
- {@link #CMD_AFTER_ACTION} - Before the file is gotten
- {@link #CMD_CLOSE} - When the repo is closed and no more actions willtake place
was a success - {@link #CMD_ABORT_PUT} - When the put is aborted.
- {@link #CMD_CLOSE} - To close the repository.
Additionally, it is possible to set the {@link #CMD_SHELL} and the{@link #CMD_PATH}. Notice that you can use the ${global} macro to read global (that is, machine local) settings from the ~/.bnd/settings.json file (can be managed with bnd).