public class GeoServerRESTPublisher extends Object
There are no modifiable instance fields, so all the calls are thread-safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
GeoServerRESTPublisher.CoverageStoreExtension
Raster data format being uploaded.
|
static class |
GeoServerRESTPublisher.DataStoreExtension
Vector data format being uploaded.
|
static class |
GeoServerRESTPublisher.DataStoreType
Deprecated.
|
static class |
GeoServerRESTPublisher.Format
Represents the format used to GET, PUT or POST information via REST.
|
static class |
GeoServerRESTPublisher.ParameterConfigure
Control if feature types are to be automatically configured upon file upload.
|
static class |
GeoServerRESTPublisher.ParameterUpdate
Controls how existing data is handled when the file is PUT into a datastore that (a) already exists and (b) already contains a schema that
matches the content of the file.
|
static class |
GeoServerRESTPublisher.Purge |
static class |
GeoServerRESTPublisher.StoreType
DataStoreType definitions.
|
static class |
GeoServerRESTPublisher.UploadMethod
Specifies the method used to publish a resource.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CRS |
| Constructor and Description |
|---|
GeoServerRESTPublisher(String restURL,
String username,
String password)
Creates a GeoServerRESTPublisher to connect against a GeoServer instance with the given URL and user credentials.
|
| Modifier and Type | Method and Description |
|---|---|
String |
backup(String backupDir)
Issues a GeoServer BACKUP.
|
String |
backup(String backupDir,
boolean includedata,
boolean includegwc,
boolean includelog)
Issues a GeoServer BACKUP.
|
boolean |
configureCoverage(GSCoverageEncoder ce,
String wsname,
String csname)
Configure an existing coverage in a given workspace and coverage store
|
boolean |
configureCoverage(GSCoverageEncoder ce,
String wsname,
String csname,
String coverageName)
Configure an existing coverage in a given workspace and coverage store
|
boolean |
configureLayer(String workspace,
String resourceName,
GSLayerEncoder layer)
Allows to configure some layer attributes such as DefaultStyle
|
boolean |
configureLayerGroup(String name,
GSLayerGroupEncoder group)
Update a LayerGroup using the specified encoder
|
boolean |
configureLayerGroup(String workspace,
String name,
GSLayerGroupEncoder group)
Update a LayerGroup using the specified encoder
|
boolean |
createCoverage(GSCoverageEncoder ce,
String wsname,
String csname)
Deprecated.
|
boolean |
createCoverage(String wsname,
String storeName,
GSCoverageEncoder ce)
Create a new coverage in a given workspace and coverage store
|
boolean |
createExternalMosaic(String workspace,
String storeName,
File mosaicDir,
GSCoverageEncoder coverageEncoder,
GSLayerEncoder layerEncoder)
|
RESTCoverageStore |
createExternaMosaicDatastore(String workspace,
String storeName,
File mosaicDir,
GeoServerRESTPublisher.ParameterConfigure configure,
GeoServerRESTPublisher.ParameterUpdate update)
Publish a Mosaic from a filesystem currently readable by GeoServer.
|
boolean |
createImageMosaic(String workspace,
String coverageStore,
String path)
Create a new ImageMosaic with the provided configuration provided as a zip file.
|
boolean |
createImageMosaic(String workspace,
String coverageStore,
String path,
GeoServerRESTStructuredGridCoverageReaderManager.ConfigureCoveragesOption configureOpt)
Create a new ImageMosaic with the provided configuration provided as a zip file.
|
boolean |
createLayerGroup(String name,
GSLayerGroupEncoder group)
Create a new LayerGroup using the specified encoder
|
boolean |
createLayerGroup(String workspace,
String name,
GSLayerGroupEncoder group)
Create a new LayerGroup using the specified encoder
|
boolean |
createNamespace(String prefix,
URI uri)
Create a new Namespace.
|
boolean |
createPostGISDatastore(String workspace,
GSPostGISDatastoreEncoder datastoreEncoder)
Deprecated.
Will be deleted in next version 1.5.x, use
GeoServerRESTDatastoreManager instead. |
boolean |
createWorkspace(String workspace)
Create a new Workspace.
|
boolean |
createWorkspace(String name,
URI uri)
Create both a workspace and its associated namespace.
|
protected String |
encode(String s)
URL-encodes a String.
|
boolean |
harvestExternal(String workspace,
String coverageStore,
String format,
String path)
Create a store or harvest the coverage from the provided external path.
|
boolean |
publishArcGrid(String workspace,
String storeName,
File arcgrid)
Upload and publish a ArcGrid image.
|
boolean |
publishArcGrid(String workspace,
String storeName,
String coverageName,
File arcgrid)
Upload and publish a ArcGrid image.
|
boolean |
publishArcGrid(String workspace,
String storeName,
String coverageName,
File arcgrid,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle,
double[] bbox)
Upload and publish a ArcGrid image.
|
boolean |
publishDBLayer(String workspace,
String storename,
GSFeatureTypeEncoder fte,
GSLayerEncoder layerEncoder)
Publish and configure a new layer from an existing DataStore (v.
|
boolean |
publishDBLayer(String workspace,
String storename,
String layername,
String srs,
String defaultStyle)
Deprecated.
Will be removed in the next release.
|
RESTCoverageStore |
publishExternalArcGrid(String workspace,
String storeName,
File arcgrid,
GSCoverageEncoder coverageEncoder,
GSLayerEncoder layerEncoder)
Publish a ArcGrid already in a filesystem readable by GeoServer.
|
boolean |
publishExternalArcGrid(String workspace,
String storeName,
File arcgrid,
String coverageName,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Publish a ArcGrid already in a filesystem readable by GeoServer.
|
RESTCoverageStore |
publishExternalGeoTIFF(String workspace,
String storeName,
File geotiff,
GSCoverageEncoder coverageEncoder,
GSLayerEncoder layerEncoder)
Publish a GeoTiff already in a filesystem readable by GeoServer.
|
boolean |
publishExternalGeoTIFF(String workspace,
String storeName,
File geotiff,
String coverageName,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Publish a GeoTiff already in a filesystem readable by GeoServer.
|
boolean |
publishExternalMosaic(String workspace,
String storeName,
File mosaicDir,
GSCoverageEncoder coverageEncoder,
GSLayerEncoder layerEncoder)
Publish a Mosaic already in a filesystem readable by GeoServer.
|
boolean |
publishExternalMosaic(String workspace,
String storeName,
File mosaicDir,
String srs,
String defaultStyle)
Publish a Mosaic already in a filesystem readable by GeoServer.
|
boolean |
publishGeoTIFF(String workspace,
String storeName,
File geotiff)
Upload and publish a GeoTIFF image.
|
boolean |
publishGeoTIFF(String workspace,
String storeName,
String coverageName,
File geotiff)
Upload and publish a GeoTIFF image.
|
boolean |
publishGeoTIFF(String workspace,
String storeName,
String resourceName,
File geotiff,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Deprecated.
use the former method with bbox set to null.
|
boolean |
publishGeoTIFF(String workspace,
String storeName,
String coverageName,
File geotiff,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle,
double[] bbox)
Upload and publish a GeoTIFF image.
|
boolean |
publishImageMosaic(String workspace,
String storeName,
File zipFile)
Publish imagemosaic as zip file.
|
boolean |
publishImageMosaic(String workspace,
String storeName,
File zipFile,
GeoServerRESTPublisher.ParameterConfigure configure,
org.apache.commons.httpclient.NameValuePair... params)
Publish imagemosaic as zip file.
|
boolean |
publishMosaicLayer(String workspace,
String storename,
GSCoverageEncoder cove,
GSLayerEncoder layerEncoder) |
boolean |
publishServiceLayer(String workspace,
String servicetype,
GSServiceSettingsEncoder serviceEncoder) |
boolean |
publishShp(String workspace,
String storeName,
org.apache.commons.httpclient.NameValuePair[] storeParams,
String datasetName,
GeoServerRESTPublisher.UploadMethod method,
URI shapefile,
String srs,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Deprecated.
use
publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, String) instead as the behaviour of
this method is misleading as it allows you to use wrong ProjectionPolicy values. |
boolean |
publishShp(String workspace,
String storeName,
org.apache.commons.httpclient.NameValuePair[] storeParams,
String datasetName,
GeoServerRESTPublisher.UploadMethod method,
URI shapefile,
String srs,
String defaultStyle)
Publish a shapefile.
|
boolean |
publishShp(String workspace,
String storeName,
org.apache.commons.httpclient.NameValuePair[] storeParams,
String datasetName,
GeoServerRESTPublisher.UploadMethod method,
URI shapefile,
String srs,
String nativeCRS,
GSResourceEncoder.ProjectionPolicy policy,
String defaultStyle)
Publish a shapefile.
|
boolean |
publishShp(String workspace,
String storename,
String datasetname,
File zipFile)
Upload an publish a local shapefile.
|
boolean |
publishShp(String workspace,
String storename,
String layername,
File zipFile,
String srs)
Publish a zipped shapefile forcing the srs to the one provided.
|
boolean |
publishShp(String workspace,
String storename,
String layername,
File zipFile,
String srs,
org.apache.commons.httpclient.NameValuePair... params)
Publish a zipped shapefile.
|
boolean |
publishShp(String workspace,
String storename,
String layerName,
File zipFile,
String srs,
String defaultStyle)
Publish a zipped shapefile.
|
boolean |
publishShpCollection(String workspace,
String storeName,
URI resource)
Publish a collection of shapefiles.
|
boolean |
publishStyle(File sldFile)
Store and publish a Style.
|
boolean |
publishStyle(File sldFile,
String name)
Store and publish a Style, assigning it a name.
|
boolean |
publishStyle(File sldFile,
String name,
boolean raw)
Store and publish a Style, assigning it a name and choosing the raw format.
|
boolean |
publishStyle(String sldBody)
Store and publish a Style.
|
boolean |
publishStyle(String sldBody,
String name)
Store and publish a Style, assigning it a name.
|
boolean |
publishStyle(String sldBody,
String name,
boolean raw)
Store and publish a Style, assigning it a name and choosing the raw format.
|
boolean |
publishStyleInWorkspace(String workspace,
File sldFile) |
boolean |
publishStyleInWorkspace(String workspace,
File sldFile,
String name) |
boolean |
publishStyleInWorkspace(String workspace,
String sldBody) |
boolean |
publishStyleInWorkspace(String workspace,
String sldBody,
String name) |
boolean |
publishWfsServiceLayer(String workspace,
GSServiceSettingsEncoder serviceEncoder) |
boolean |
publishWmsServiceLayer(String workspace,
GSServiceSettingsEncoder serviceEncoder) |
boolean |
publishWorldImage(String workspace,
String coveragestore,
File zipFile)
Publish a zipped worldimage file.
|
boolean |
publishWorldImage(String workspace,
String coveragestore,
File zipFile,
GeoServerRESTPublisher.ParameterConfigure configure,
org.apache.commons.httpclient.NameValuePair... params)
Publish a zipped worldimage file.
|
boolean |
reload()
Reload the target geoserver configuration
|
boolean |
reloadStore(String workspace,
String storeName,
GeoServerRESTPublisher.StoreType storeType)
/workspaces/
|
boolean |
removeCoverageStore(String workspace,
String storename)
Deprecated.
|
boolean |
removeCoverageStore(String workspace,
String storename,
boolean recurse)
Remove a given CoverageStore in a given Workspace.
|
boolean |
removeCoverageStore(String workspace,
String storename,
boolean recurse,
GeoServerRESTPublisher.Purge purge)
Remove a given CoverageStore in a given Workspace.
|
boolean |
removeDatastore(String workspace,
String storename)
Deprecated.
will be removed in next release use
removeDatastore(String, String, boolean) |
boolean |
removeDatastore(String workspace,
String storename,
boolean recurse)
Remove a given Datastore in a given Workspace.
|
boolean |
removeDatastore(String workspace,
String storename,
boolean recurse,
GeoServerRESTPublisher.Purge purge) |
boolean |
removeGranuleById(String workspace,
String coverageStore,
String coverage,
String granuleId)
Remove a granule from a structured coverage by id.
|
boolean |
removeGranulesByCQL(String workspace,
String coverageStore,
String coverage,
String filter)
Remove granules from a structured coverage, by providing a CQL filter.
|
boolean |
removeLayer(String workspace,
String layerName)
remove a generic given layer from a given workspace
|
boolean |
removeLayerGroup(String name)
Remove a layer group.
|
boolean |
removeLayerGroup(String workspace,
String name)
Remove a layer group.
|
boolean |
removeNamespace(String prefix,
boolean recurse)
Remove a given Namespace.
|
boolean |
removeStyle(String styleName)
Remove a Style.
|
boolean |
removeStyle(String styleName,
boolean purge)
Remove a Style.
|
boolean |
removeStyleInWorkspace(String workspace,
String styleName) |
boolean |
removeStyleInWorkspace(String workspace,
String styleName,
boolean purge) |
boolean |
removeWorkspace(String workspace)
Deprecated.
|
boolean |
removeWorkspace(String workspace,
boolean recurse)
Remove a given Workspace.
|
boolean |
reset()
Reset the target geoserver configuration
|
String |
restore(String backupDir)
Issues a GeoServer RESTORE.
|
protected String |
sanitize(String s)
Appends ".DUMMY" to any string containing a dot (sic).
|
boolean |
unpublishCoverage(String workspace,
String storename,
String layerName)
Remove the Coverage configuration from GeoServer.
|
boolean |
unpublishFeatureType(String workspace,
String storename,
String layerName)
Removes the featuretype and the associated layer.
|
boolean |
updateNamespace(String prefix,
URI uri)
Update a Namespace URI.
|
boolean |
updateStyle(File sldFile,
String name)
Update a Style.
|
boolean |
updateStyle(File sldFile,
String name,
boolean raw)
Update a Style.
|
boolean |
updateStyle(String sldBody,
String name)
Update a Style.
|
boolean |
updateStyle(String sldBody,
String name,
boolean raw)
Update a Style.
|
boolean |
updateStyleInWorkspace(String workspace,
File sldFile,
String name) |
boolean |
updateStyleInWorkspace(String workspace,
String sldBody,
String name) |
public static final String DEFAULT_CRS
public GeoServerRESTPublisher(String restURL, String username, String password)
restURL - the base GeoServer URL (e.g.: http://localhost:8080/geoserver)username - auth credentialpassword - auth credentialpublic String backup(String backupDir) throws IllegalArgumentException
Won't include data, cached tiles, or logs. Use backup(String, boolean, boolean, boolean) to control these parameters.
backupDir - the target Backup Dir String.IllegalArgumentException - if the backupDir is null or emptypublic String backup(String backupDir, boolean includedata, boolean includegwc, boolean includelog) throws IllegalArgumentException
backupDir - the target Backup Dir String.includedata - whether or not include the data dir Boolean.includegwc - whether or not include the geowebcache dir Boolean.includelog - whether or not include the log dir Boolean.IllegalArgumentException - if the backupDir is null or empty.public String restore(String backupDir) throws IllegalArgumentException
backupDir - the source backup dir.IllegalArgumentException - if the backupDir is null or emptypublic boolean createWorkspace(String workspace)
GeoServer will automatically create an associated Namespace with the URI being "http://{workspaceName}". To specify a custom Namespace URI, use
createWorkspace(String, URI).
workspace - The name of the new workspace.public boolean createWorkspace(String name, URI uri)
Note that this method is equivalent to createNamespace(java.lang.String, java.net.URI).
name - Name for the new workspace, which will be also its associated namespace prefix.uri - Namespace URI. Cannot be empty.public boolean createNamespace(String prefix, URI uri)
prefix - The name of the new Namespace.uri - The URI of the new Namespace.public boolean updateNamespace(String prefix, URI uri)
prefix - The prefix of an existing Namespace.uri - The new URI.public boolean removeNamespace(String prefix, boolean recurse)
prefix - The Namespace prefixrecurse - The recurse parameter is used to recursively delete all resources contained in the workspace associated with this Namespace.
This includes data stores, coverage stores, feature types, etc... Allowable values for this parameter are true or false.
The default (safer) value is false.public boolean publishStyle(String sldBody)
sldBody - the full SLD document as a String.public boolean publishStyle(String sldBody, String name) throws IllegalArgumentException
sldBody - the full SLD document as a String.name - the Style name.IllegalArgumentException - if the style body is null or empty.public boolean publishStyle(File sldFile)
sldFile - the File containing the SLD document.public boolean publishStyle(File sldFile, String name)
sldFile - the File containing the SLD document.name - the Style name.public boolean publishStyle(String sldBody, String name, boolean raw)
sldBody - the full SLD document as a String.name - the Style name.raw - the raw formatpublic boolean publishStyle(File sldFile, String name, boolean raw)
sldFile - the File containing the SLD document.name - the Style name.raw - the raw formatpublic boolean updateStyle(File sldFile, String name, boolean raw) throws IllegalArgumentException
sldFile - the File containing the SLD document.name - the Style name.raw - the raw formatIllegalArgumentException - if the style body or name are null or empty.public boolean updateStyle(String sldBody, String name, boolean raw) throws IllegalArgumentException
sldBody - the new SLD document as a String.name - the Style name.raw - the raw formatIllegalArgumentException - if the style body or name are null or empty.public boolean updateStyle(String sldBody, String name) throws IllegalArgumentException
sldBody - the new SLD document as a String.name - the Style name to update.IllegalArgumentException - if the style body or name are null or empty.public boolean updateStyle(File sldFile, String name) throws IllegalArgumentException
sldFile - the File containing the SLD document.name - the Style name.IllegalArgumentException - if the sldFile file or name are null or name is empty.public boolean removeStyle(String styleName, boolean purge) throws IllegalArgumentException
The Style will be unpublished, and (optionally) the SLD file will be removed.
styleName - the name of the Style to remove.purge - remove the related SLD file from disk.IllegalArgumentException - if styleName is null or empty.public boolean removeStyle(String styleName)
The Style will be unpublished and the related SLD file will be removed.
styleName - the name of the Style to remove.public boolean publishStyleInWorkspace(String workspace, String sldBody)
GeoServerRESTStyleManager#public boolean publishStyleInWorkspace(String workspace, String sldBody, String name) throws IllegalArgumentException
IllegalArgumentExceptionGeoServerRESTStyleManager#public boolean publishStyleInWorkspace(String workspace, File sldFile)
GeoServerRESTStyleManager.publishStyleInWorkspace(java.lang.String, java.io.File)public boolean publishStyleInWorkspace(String workspace, File sldFile, String name)
GeoServerRESTStyleManager.publishStyleInWorkspace(java.lang.String, java.io.File, java.lang.String)public boolean updateStyleInWorkspace(String workspace, String sldBody, String name) throws IllegalArgumentException
IllegalArgumentExceptionGeoServerRESTStyleManager.updateStyleInWorkspace(java.lang.String, java.lang.String, java.lang.String)public boolean updateStyleInWorkspace(String workspace, File sldFile, String name) throws IllegalArgumentException
IllegalArgumentExceptionGeoServerRESTStyleManager.updateStyleInWorkspace(java.lang.String, java.io.File, java.lang.String)public boolean removeStyleInWorkspace(String workspace, String styleName, boolean purge) throws IllegalArgumentException
IllegalArgumentExceptionGeoServerRESTStyleManager.removeStyleInWorkspace(java.lang.String, java.lang.String, boolean)public boolean removeStyleInWorkspace(String workspace, String styleName)
GeoServerRESTStyleManager.removeStyleInWorkspace(java.lang.String, java.lang.String)public boolean createPostGISDatastore(String workspace, GSPostGISDatastoreEncoder datastoreEncoder)
GeoServerRESTDatastoreManager instead.workspace - Name of the workspace to contain the database. This will also be the prefix of any layer names created from tables in the
database.datastoreEncoder - the set of parameters to be set to the datastore (including connection params).public boolean publishDBLayer(String workspace, String storename, String layername, String srs, String defaultStyle)
public boolean publishDBLayer(String workspace, String storename, GSFeatureTypeEncoder fte, GSLayerEncoder layerEncoder)
workspace - Workspace name where DataStore is.storename - DataStore name.fte - FeatureType configuration details using a GSFeatureTypeEncoder.true if layer is successfully created.public boolean publishShp(String workspace, String storename, String datasetname, File zipFile) throws FileNotFoundException, IllegalArgumentException
The SRS will be set to EPSG:4326.
workspace - The workspace name.storename - The store name.layername - The layer name.zipFile - The zipped file to publish.true if the operation completed successfully.FileNotFoundException - , IllegalArgumentExceptionIllegalArgumentException#publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, ProjectionPolicy, String)}public boolean publishShp(String workspace, String storeName, org.apache.commons.httpclient.NameValuePair[] storeParams, String datasetName, GeoServerRESTPublisher.UploadMethod method, URI shapefile, String srs, String nativeCRS, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace - the name of the workspace to usestorename - the name of the store to createstoreParams - parameters to append to the url (can be null).layername - the name of the layer to configuremethod - GeoServerRESTPublisher.UploadMethodfileUri - the uri of the file containing the shapefile.It should be:
srs - the SRS for this shapefile. It must be an ESPG code or GeoServer will choke.nativeCRS - the nativeCRS for this shapefile. It can be an EPSG code (for GSResourceEncoder.ProjectionPolicy.NONE or a WKT for
GSResourceEncoder.ProjectionPolicy.REPROJECT_TO_DECLARED.policy - GSResourceEncoder.ProjectionPolicydefaultStyle - the default style to set (can be null).FileNotFoundException - if file to upload is not foundIllegalArgumentException - if any of the mandatory arguments are null.public boolean publishShp(String workspace, String storeName, org.apache.commons.httpclient.NameValuePair[] storeParams, String datasetName, GeoServerRESTPublisher.UploadMethod method, URI shapefile, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, String) instead as the behaviour of
this method is misleading as it allows you to use wrong ProjectionPolicy values.workspace - the name of the workspace to usestorename - the name of the store to createstoreParams - parameters to append to the url (can be null).layername - the name of the layer to configuremethod - GeoServerRESTPublisher.UploadMethodfileUri - the uri of the file containing the shapefile.It should be:
srs - the SRS for this shapefile. It must be an ESPG code or GeoServer will choke. Notice that we can only use
GSResourceEncoder.ProjectionPolicy.FORCE_DECLARED.policy - GSResourceEncoder.ProjectionPolicydefaultStyle - the default style to set (can be null).FileNotFoundException - if file to upload is not foundIllegalArgumentException - if any of the mandatory arguments are null.public boolean publishShp(String workspace, String storeName, org.apache.commons.httpclient.NameValuePair[] storeParams, String datasetName, GeoServerRESTPublisher.UploadMethod method, URI shapefile, String srs, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace - the name of the workspace to usestorename - the name of the store to createstoreParams - parameters to append to the url (can be null).layername - the name of the layer to configuremethod - GeoServerRESTPublisher.UploadMethodfileUri - the uri of the file containing the shapefile.It should be:
srs - the SRS for this shapefile. It must be an ESPG code or GeoServer will choke.defaultStyle - the default style to set (can be null).FileNotFoundException - if file to upload is not foundIllegalArgumentException - if any of the mandatory arguments are null.public boolean publishShp(String workspace, String storename, String layerName, File zipFile, String srs, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace - the name of the workspace to usestorename - the name of the store to createlayerName - the name of the layer to configurezipFile - The zipped file to publishsrs - the srs for this shapefile. It will be forced to use this one in GeoServer using GSResourceEncoder.ProjectionPolicy.FORCE_DECLARED.defaultStyle - the default style to set (can be null).true if the operation completed successfullyFileNotFoundException - if file to upload is not foundIllegalArgumentException - if any of the mandatory arguments are null.#publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, ProjectionPolicy, String)}public boolean publishShp(String workspace, String storename, String layername, File zipFile, String srs) throws FileNotFoundException
workspace - the name of the workspace to usestorename - the name of the store to createlayername - the name of the layer to configurezipFile - The zipped file to publishsrs - the CRS for this shapefile. It must be an EPSG CODE !true if the operation completed successfully.FileNotFoundException - if file to upload is not foundIllegalArgumentException - if any of the mandatory arguments are null.#publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, ProjectionPolicy, String)}public boolean publishShp(String workspace, String storename, String layername, File zipFile, String srs, org.apache.commons.httpclient.NameValuePair... params) throws FileNotFoundException, IllegalArgumentException
workspace - the name of the workspace to usestorename - the name of the store to createlayername - the name of the layer to configurezipFile - the zip file containing the shapefilesrs - the shapefile srs. This must be an EPSG Codefor this code to work!params - parameters to append to the url (can be null).true if the operation completed successfully.FileNotFoundException - if file to upload is not foundIllegalArgumentException - if any of the mandatory arguments are null.#publishShp(String, String, NameValuePair[], String, UploadMethod, URI, String, ProjectionPolicy, String)}public boolean publishShpCollection(String workspace, String storeName, URI resource) throws FileNotFoundException
Will automatically create the store and publish each shapefile as a layer.
workspace - the name of the workspace to usestoreName - the name of the store to createresource - the shapefile collection. It can be:
true if publication successful.FileNotFoundException - if the specified zip file does not exist.public boolean publishArcGrid(String workspace, String storeName, File arcgrid) throws FileNotFoundException
workspace - Workspace to usestoreName - The store name to be used or created.arcgrid - The ArcGrid file.FileNotFoundException - if ArcGrid file does not exist.public boolean publishArcGrid(String workspace, String storeName, String coverageName, File arcgrid) throws FileNotFoundException, IllegalArgumentException
workspace - Workspace to usestoreName - Name of the coveragestore (if null the file name will be used)coverageName - the name of the coverage (if null the file name will be used)arcgrid - file to uploadFileNotFoundException - if file does not existsIllegalArgumentException - if workspace or arcgrid are nullpublic boolean publishArcGrid(String workspace, String storeName, String coverageName, File arcgrid, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle, double[] bbox) throws FileNotFoundException, IllegalArgumentException
workspace - Workspace to usestoreName - Name of the coveragestore (if null the file name will be used)coverageName - the name of the coverage (if null the file name will be used)arcgrid - file to uploadsrs - the native CRSpolicy - projection policy. See GSResourceEncoder.ProjectionPolicy.defaultStyle - the default style to apply.bbox - An array of 4 doubles indicating envelope in EPSG:4326. Order is [Xmin, Ymin, Xmax, Ymax].FileNotFoundException - if file does not existsIllegalArgumentException - if workspace or arcgrid are nullpublic boolean publishExternalArcGrid(String workspace, String storeName, File arcgrid, String coverageName, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace - an existing workspacestoreName - the coverageStore to be createdarcgrid - the arcGrid to be publishedsrs - the native CRSpolicy - projection policy. See GSResourceEncoder.ProjectionPolicy.defaultStyle - the default style to apply.FileNotFoundException - if file does not existsIllegalArgumentException - if any of the mandatory parameters are null.public RESTCoverageStore publishExternalArcGrid(String workspace, String storeName, File arcgrid, GSCoverageEncoder coverageEncoder, GSLayerEncoder layerEncoder) throws IllegalArgumentException, FileNotFoundException
workspace - an existing workspacestoreName - the coverageStore to be createdarcgrid - the arcGrid to be publishedcoverageEncoder - coverage details. See GSCoverageEncoder.layerEncoder - layer details, See GSLayerEncoder.FileNotFoundException - if file does not existsIllegalArgumentException - if any of the mandatory parameters are null.public boolean publishGeoTIFF(String workspace, String storeName, File geotiff) throws FileNotFoundException
workspace - Workspace to usestoreName - The store name to be used or created.geotiff - The GeoTIFF file.FileNotFoundException - if GeoTIFF file does not exist.public boolean publishGeoTIFF(String workspace, String storeName, String coverageName, File geotiff) throws FileNotFoundException, IllegalArgumentException
workspace - Workspace to usestoreName - Name of the coveragestore (if null the file name will be used)coverageName - the name of the coverage (if null the file name will be used)geotiff - file to uploadFileNotFoundException - if file does not existsIllegalArgumentException - if workspace or geotiff are nullpublic boolean publishGeoTIFF(String workspace, String storeName, String resourceName, File geotiff, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
#publishGeoTIFF(String, String, String, File, String, ProjectionPolicy, String, double[]) but without the last parameter
(bbox). Kept here for backwards compatibility.public boolean publishGeoTIFF(String workspace, String storeName, String coverageName, File geotiff, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle, double[] bbox) throws FileNotFoundException, IllegalArgumentException
workspace - Workspace to usestoreName - Name of the coveragestore (if null the file name will be used)coverageName - the name of the coverage (if null the file name will be used)geotiff - file to uploadsrs - the native CRSpolicy - projection policy. See GSResourceEncoder.ProjectionPolicy.defaultStyle - the default style to apply.bbox - An array of 4 doubles indicating envelope in EPSG:4326. Order is [Xmin, Ymin, Xmax, Ymax].FileNotFoundException - if file does not existsIllegalArgumentException - if workspace or geotiff are nullpublic boolean publishExternalGeoTIFF(String workspace, String storeName, File geotiff, String coverageName, String srs, GSResourceEncoder.ProjectionPolicy policy, String defaultStyle) throws FileNotFoundException, IllegalArgumentException
workspace - an existing workspacestoreName - the coverageStore to be createdgeotiff - the geoTiff to be publishedsrs - the native CRSpolicy - projection policy. See GSResourceEncoder.ProjectionPolicy.defaultStyle - the default style to apply.FileNotFoundException - if file does not existsIllegalArgumentException - if any of the mandatory parameters are null.public RESTCoverageStore publishExternalGeoTIFF(String workspace, String storeName, File geotiff, GSCoverageEncoder coverageEncoder, GSLayerEncoder layerEncoder) throws IllegalArgumentException, FileNotFoundException
workspace - an existing workspacestoreName - the coverageStore to be createdgeotiff - the geoTiff to be publishedcoverageEncoder - coverage details. See GSCoverageEncoder.layerEncoder - layer details, See GSLayerEncoder.FileNotFoundException - if file does not existsIllegalArgumentException - if any of the mandatory parameters are null.public boolean publishWorldImage(String workspace, String coveragestore, File zipFile) throws FileNotFoundException
workspace - Workspace to usecoveragestore - Name of the coveragestorezipFile - zip file to uploadFileNotFoundExceptionpublic boolean publishWorldImage(String workspace, String coveragestore, File zipFile, GeoServerRESTPublisher.ParameterConfigure configure, org.apache.commons.httpclient.NameValuePair... params) throws FileNotFoundException
workspace - Workspace to usecoveragestore - Name of the coveragestorezipFile - zip file to uploadconfigure - Configure parameter. See GeoServerRESTPublisher.ParameterConfigure. It can be null.params - parameters to append to the url (can be null).GeoServerRESTPublisher.ParameterConfigure.NONE.FileNotFoundExceptionpublic boolean publishImageMosaic(String workspace, String storeName, File zipFile) throws FileNotFoundException
workspace - Workspace to usestoreName - Name of the coveragestorezipFile - file to uploadFileNotFoundExceptionpublic boolean publishImageMosaic(String workspace, String storeName, File zipFile, GeoServerRESTPublisher.ParameterConfigure configure, org.apache.commons.httpclient.NameValuePair... params) throws FileNotFoundException
workspace - Workspace to usestoreName - Name of the coveragestorezipFile - file to uploadconfigure - Configure parameter. See GeoServerRESTPublisher.ParameterConfigure. It can be null.params - parameters to append to the url (can be null).FileNotFoundExceptionpublic RESTCoverageStore createExternaMosaicDatastore(String workspace, String storeName, File mosaicDir, GeoServerRESTPublisher.ParameterConfigure configure, GeoServerRESTPublisher.ParameterUpdate update) throws FileNotFoundException
workspace - an existing workspacestoreName - the name of the coverageStore to be createdmosaicDir - the directory where the raster images are locatedconfigure - a specify if a coverage should be configuredFileNotFoundExceptionpublic boolean publishExternalMosaic(String workspace, String storeName, File mosaicDir, String srs, String defaultStyle) throws FileNotFoundException
workspace - an existing workspacestoreName - the name of the coverageStore to be createdmosaicDir - the directory where the raster images are locatedsrs - the coverage declared SRSdefaultStyle - may be nullFileNotFoundExceptionpublic boolean createExternalMosaic(String workspace, String storeName, File mosaicDir, GSCoverageEncoder coverageEncoder, GSLayerEncoder layerEncoder) throws FileNotFoundException
FileNotFoundExceptionpublic boolean publishExternalMosaic(String workspace, String storeName, File mosaicDir, GSCoverageEncoder coverageEncoder, GSLayerEncoder layerEncoder) throws FileNotFoundException, IllegalArgumentException
workspace - an existing workspacestoreName - the name of the coverageStore to be createdmosaicDir - the directory where the raster images are locatedcoverageEncoder - the set of parameters to be set to the coverage (bbox, srs, ...)layerEncoder - the set of parameters to be set to the layer (defaultstyle, wmspath, ...)FileNotFoundExceptionIllegalArgumentExceptionpublic boolean unpublishCoverage(String workspace, String storename, String layerName)
First, the associated layer is removed, then the Coverage configuration itself.
CHECKME Maybe the coveragestore has to be removed as well.
public boolean unpublishFeatureType(String workspace, String storename, String layerName)
You may also want to remove the datastore.
public boolean removeDatastore(String workspace, String storename)
removeDatastore(String, String, boolean)workspace - The name of the workspacestorename - The name of the Datastore to remove.public boolean removeDatastore(String workspace, String storename, boolean recurse) throws IllegalArgumentException
workspace - The name of the workspacestorename - The name of the Datastore to remove.recurse - if remove should be performed recursivelyIllegalArgumentException - if workspace or storename are null or emptypublic boolean removeDatastore(String workspace, String storename, boolean recurse, GeoServerRESTPublisher.Purge purge) throws IllegalArgumentException
IllegalArgumentExceptionpublic boolean removeCoverageStore(String workspace, String storename)
removeCoverageStore(String, String, boolean)workspace - The name of the workspacestorename - The name of the CoverageStore to remove.public boolean removeCoverageStore(String workspace, String storename, boolean recurse) throws IllegalArgumentException
workspace - The name of the workspacestorename - The name of the CoverageStore to remove.recurse - if remove should be performed recursivelyIllegalArgumentExceptionpublic boolean removeCoverageStore(String workspace, String storename, boolean recurse, GeoServerRESTPublisher.Purge purge) throws IllegalArgumentException
workspace - The name of the workspacestorename - The name of the CoverageStore to remove.recurse - if remove should be performed recursivelypurge - the purge methodIllegalArgumentExceptionpublic boolean removeWorkspace(String workspace)
removeWorkspace(String, boolean)workspace - the workspace to removeGeoServerRESTPublisher#removeWorkspace(String, boolean)}public boolean removeWorkspace(String workspace, boolean recurse) throws IllegalArgumentException
workspace - The name of the workspacerecurse - The recurse parameter is used to recursively delete all resources contained by the specified workspace. This includes data
stores, coverage stores, feature types, etc... Allowable values for this parameter are true or false. The default value is
false.IllegalArgumentExceptionpublic boolean removeLayerGroup(String workspace, String name)
workspace - the layer group workspace.name - the layer group name.public boolean removeLayerGroup(String name)
name - the layer group name.public boolean removeLayer(String workspace, String layerName)
workspace - layerName - public boolean reloadStore(String workspace, String storeName, GeoServerRESTPublisher.StoreType storeType) throws IllegalArgumentException, MalformedURLException
workspace - storeName - mosaicDir - FileNotFoundExceptionIllegalArgumentExceptionMalformedURLExceptionpublic boolean reload()
public boolean reset()
public boolean configureLayer(String workspace, String resourceName, GSLayerEncoder layer) throws IllegalArgumentException
workspace - resourceName - the name of the resource to use (featureStore or coverageStore name)layer - the layer encoder used to configure the layerIllegalArgumentException - if some arguments are null or emptypublic boolean createLayerGroup(String name, GSLayerGroupEncoder group)
name - name of the layer groupgroup - group encoderpublic boolean createLayerGroup(String workspace, String name, GSLayerGroupEncoder group)
workspace - name of the workspacename - name of the layer groupgroup - group encoderpublic boolean configureLayerGroup(String name, GSLayerGroupEncoder group)
name - name of the layer groupgroup - group encoderpublic boolean configureLayerGroup(String workspace, String name, GSLayerGroupEncoder group)
workspace - name of the workspacename - name of the layer groupgroup - group encoderpublic boolean configureCoverage(GSCoverageEncoder ce, String wsname, String csname)
ce - contains the coverage name to configure and the configuration to applywsname - the workspace to search for existent coveragecsname - the coverage store to search for existent coveragepublic boolean configureCoverage(GSCoverageEncoder ce, String wsname, String csname, String coverageName)
ce - contains the coverage name to configure and the configuration to applywsname - the workspace to search for existent coveragecsname - the coverage store to search for existent coveragecoverageName - the name of the coverage, useful for changing name for the coverage itselfpublic boolean createCoverage(GSCoverageEncoder ce, String wsname, String csname)
createCoverage(String, String, GSCoverageEncoder)public boolean createCoverage(String wsname, String storeName, GSCoverageEncoder ce) throws IllegalArgumentException
wsname - the workspace to search for existent coveragestoreName - an existent store name to use as data sourcece - contains the coverage name to create and the configuration to applyIllegalArgumentException - if arguments are null or emptyprotected String encode(String s)
s - The original string.public boolean harvestExternal(String workspace, String coverageStore, String format, String path)
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStoreformat - the format of the file to uploadthe - absolut path to the file to uploadtrue if the call succeeds or false otherwise.public boolean createImageMosaic(String workspace, String coverageStore, String path)
This call configures all the coverages contained in the ImageMosaic.
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStorethe - absolute path to the file to uploadtrue if the call succeeds or false otherwise.public boolean createImageMosaic(String workspace, String coverageStore, String path, GeoServerRESTStructuredGridCoverageReaderManager.ConfigureCoveragesOption configureOpt)
With the options configure we can decide whether or not to configure or not the coverages contained in the ImageMosaic.
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStorethe - absolute path to the file to uploadconfigureOpt - tells GeoServer whether to configure all coverages in this mosaic (ALL) or none of them (NONE).true if the call succeeds or false otherwise.public boolean removeGranuleById(String workspace, String coverageStore, String coverage, String granuleId)
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStorecoverage - the name of the target coverage from which we are going to removefilter - the absolute path to the file to uploadnull in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.MalformedURLExceptionUnsupportedEncodingExceptionpublic boolean removeGranulesByCQL(String workspace, String coverageStore, String coverage, String filter) throws UnsupportedEncodingException
workspace - the GeoServer workspacecoverageStore - the GeoServer coverageStorecoverage - the name of the target coverage from which we are going to removefilter - the absolute path to the file to uploadnull in case the call does not succeed, or an instance of RESTStructuredCoverageGranulesList.MalformedURLExceptionUnsupportedEncodingExceptionpublic boolean publishServiceLayer(String workspace, String servicetype, GSServiceSettingsEncoder serviceEncoder)
public boolean publishWmsServiceLayer(String workspace, GSServiceSettingsEncoder serviceEncoder)
public boolean publishWfsServiceLayer(String workspace, GSServiceSettingsEncoder serviceEncoder)
public boolean publishMosaicLayer(String workspace, String storename, GSCoverageEncoder cove, GSLayerEncoder layerEncoder)
Copyright © 2007–2016 PDOK. All rights reserved.