From fe1c46d858ceafd63e8e77a99998b9b5cae4a3c9 Mon Sep 17 00:00:00 2001 From: marcopollivier Date: Thu, 18 Dec 2014 14:42:01 -0200 Subject: [PATCH] Creating a publish WorldImage external store --- .../rest/GeoServerRESTPublisher.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java b/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java index 374bc8b..5503b27 100644 --- a/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java +++ b/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java @@ -1691,7 +1691,43 @@ public class GeoServerRESTPublisher { return publishCoverage(workspace, coveragestore, CoverageStoreExtension.WORLDIMAGE, "application/zip", zipFile, configure, params); } + + /** + * Publish a external worldimage file. + * + * @param workspace Workspace to use + * @param coveragestore Name of the coveragestore + * @param fileUri the uri of the file containing the WorldImage. + * @param configure Configure parameter. See {@link ParameterConfigure}. It can be null. + * @param params parameters to append to the url (can be null).
+ * Accepted parameters are: + * + * @return true if the operation completed successfully. + */ + public boolean publishWorldImage(String workspace, String coveragestore, URI fileURI, + ParameterConfigure configure, NameValuePair... params) throws FileNotFoundException { + + return createCoverageStore(workspace, coveragestore, UploadMethod.EXTERNAL, CoverageStoreExtension.WORLDIMAGE, + "text/plain", fileURI, configure, params); + + } + /** + * Publish a external worldimage file. + * + * @param workspace Workspace to use + * @param coveragestore Name of the coveragestore + * @param fileUri the uri of the file containing the WorldImage. + * @return true if the operation completed successfully. + */ + public boolean publishWorldImage(String workspace, String coveragestore, URI fileURI) throws FileNotFoundException { + return createCoverageStore(workspace, coveragestore, UploadMethod.EXTERNAL, CoverageStoreExtension.WORLDIMAGE, + "text/plain", fileURI, ParameterConfigure.FIRST, (NameValuePair) null); + + } + // ========================================================================== // === MOSAIC // ==========================================================================