GeoServer : GSIP 114 - PathMapper extension point to control REST file upload locations
This page last changed on May 01, 2014 by groldan.
Rest file uploads put uploaded files in fixed locations inside the data directory. Roll an extension point to allow control of the target location
Choose one of: Under Discussion, In Progress, Completed, Rejected, Deferred
The RESTful API allows to create new stores and append new granules to mosaics via file uploads.
In particular, all files end up in the data directory, and mosaics made of a large amount of files end up having a flat structure, which is detrimental to performance.
In order to make this general enough for GeoServer core inclusion we suggest a generic path mapping mechanism, inspired by how URLMangler can transform GeoServer backlinks, that can map a uploaded file to the desired path on the server.
Add a RESTUploadPathMapper interface that allows the implementors to change the location of the files, without giving up a bit of control to ensure files associated to different workspaces are going to be located in separate directories.
The interface uses StringBuilder like URLMangler to allow path customization, the caller is free to append, modify or overwrite some bits of the paths. In particular:
REST wise, the StoreFileResource doFileUpload/handleFileUpload methods will apply the RESTUploadPathMapper implementations found in the app context in sequence in order to get the final location of the store or of the file being uploaded.
In order to avoid cross workspace contamination, the final path will always be:
Where rootDir will be initially set to $GEOSERVER_DATA_DIR/data and itemPath, if present, to the file name.
Implementation wise we believe a single RootPathMapper will be added to core, which will be used to override the default root location based on configuration.
The configuration for the root directory will be added to the global settings as part of the metadata map (the REST config module being a plugin that people could decide to remove) and per workspace local settings will be able to override it.
In order to support this a web-rest module will be created, and an extension point SettingsPanel will be created, similar to how the service page can be extended via AdminPagePanel, to add the configuration of the root path (and allow other path mappers to have a UI in the same way).
A community module with regular expression based file position mapping will follow to exercise the API further and allow spreading the files in a mosaic in subdirectories based on their dimension values.
This section should contain feedback provided by PSC members who may have a problem with the proposal.
State here any backwards compatibility issues.
|Document generated by Confluence on May 14, 2014 23:00|