Alternative to GEOS-6568 (https://jira.codehaus.org/browse/GEOS-6568)
Using raw format to publish correctly an SLD file v. 1.1.0 via REST API
This commit is contained in:
parent
3e580b73d1
commit
fd84472576
@ -260,6 +260,20 @@ public class GeoServerRESTStyleManager extends GeoServerRESTAbstractManager {
|
|||||||
return result != null;
|
return result != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean publishStyle(final File sldFile, final String name, final boolean raw) {
|
||||||
|
/*
|
||||||
|
* This is the equivalent call with cUrl:
|
||||||
|
*
|
||||||
|
* {@code curl -u admin:geoserver -XPOST \ -H 'Content-type: application/vnd.ogc.sld+xml' \ -d @$FULLSLD \
|
||||||
|
* http://$GSIP:$GSPORT/$SERVLET/rest/styles?name=name&raw=raw}
|
||||||
|
*/
|
||||||
|
String sUrl = buildPostUrl(null, name);
|
||||||
|
sUrl += "&raw=" + raw;
|
||||||
|
LOGGER.debug("POSTing new style " + name + " to " + sUrl);
|
||||||
|
String result = HTTPUtils.post(sUrl, sldFile, GeoServerRESTPublisher.Format.SLD.getContentType(), gsuser, gspass);
|
||||||
|
return result != null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a Style.
|
* Update a Style.
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user