public class GeoServerRESTStyleManager extends GeoServerRESTAbstractManager
gsBaseUrl, gspass, gsuser| Constructor and Description |
|---|
GeoServerRESTStyleManager(URL restURL,
String username,
String password)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildPostUrl(String workspace,
String name)
Creates a URL for the given stylename with the name in querystring
|
protected String |
buildUrl(String workspace,
String name,
String ext)
Creates a URL for the given stylename with the name in the REST path
|
protected String |
buildXmlUrl(String workspace,
String name) |
boolean |
existsStyle(String name)
Check if a Style exists in the configured GeoServer instance.
|
boolean |
existsStyle(String name,
boolean quietOnNotFound)
Check if a Style exists in the configured GeoServer instance.
|
boolean |
existsStyle(String workspace,
String name) |
boolean |
existsStyle(String workspace,
String name,
boolean quietOnNotFound) |
String |
getSLD(String styleName)
Get the SLD body of a Style.
|
String |
getSLD(String workspace,
String name)
Get the SLD body of a Style.
|
RESTStyle |
getStyle(String name) |
RESTStyle |
getStyle(String workspace,
String name) |
RESTStyleList |
getStyles()
Get summary info about all Styles.
|
RESTStyleList |
getStyles(String workspace)
Get summary info about Styles in a workspace.
|
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)
Store and publish a Style.
|
boolean |
publishStyleInWorkspace(String workspace,
File sldFile,
String name)
Store and publish a Style, assigning it a name.
|
boolean |
publishStyleInWorkspace(String workspace,
String sldBody)
Store and publish a Style.
|
boolean |
publishStyleInWorkspace(String workspace,
String sldBody,
String name)
Store and publish a Style, assigning it a name.
|
boolean |
removeStyle(String styleName)
Remove a Style.
|
boolean |
removeStyle(String styleName,
boolean purge)
Remove a Style.
|
boolean |
removeStyleInWorkspace(String workspace,
String styleName)
Remove a Style.
|
boolean |
removeStyleInWorkspace(String workspace,
String styleName,
boolean purge)
Remove a Style.
|
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)
Update a Style.
|
boolean |
updateStyleInWorkspace(String workspace,
String sldBody,
String name)
Update a Style.
|
public GeoServerRESTStyleManager(URL restURL, String username, String password) throws IllegalArgumentException
restURL - GeoServer REST API endpointusername - GeoServer REST API authorized usernamepassword - GeoServer REST API password for the former usernameIllegalArgumentExceptionpublic boolean existsStyle(String name) throws RuntimeException
name - the name of the style to check for.RuntimeException - if any other HTTP code than 200 or 404 was retrieved.public boolean existsStyle(String name, boolean quietOnNotFound)
name - the name of the style to check for.quietOnNotFound - if true, mute exception if false is returnedRuntimeException - if any other HTTP code than 200 or 404 was retrieved.public RESTStyleList getStyles()
RESTStyleListpublic boolean existsStyle(String workspace, String name, boolean quietOnNotFound)
public RESTStyleList getStyles(String workspace)
RESTStyleListpublic String getSLD(String workspace, String name)
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)
sldBody - the full SLD document as a String.public boolean publishStyleInWorkspace(String workspace, 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 publishStyleInWorkspace(String workspace, File sldFile)
sldFile - the File containing the SLD document.public boolean publishStyleInWorkspace(String workspace, File sldFile, String name)
sldFile - the File containing the SLD document.name - the Style name.public boolean updateStyleInWorkspace(String workspace, 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 updateStyleInWorkspace(String workspace, 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 removeStyleInWorkspace(String workspace, 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 removeStyleInWorkspace(String workspace, String styleName)
The Style will be unpublished and the related SLD file will be removed.
styleName - the name of the Style to remove.protected String buildPostUrl(String workspace, String name)
workspace - nullable workspace namename - style nameCopyright © 2007–2016 PDOK. All rights reserved.