added reload support
This commit is contained in:
parent
f179c04a42
commit
882475be5c
@ -680,6 +680,12 @@ public class GeoServerRESTPublisher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean reload() {
|
||||||
|
String sUrl = restURL + "/rest/reload";
|
||||||
|
String result = HTTPUtils.post(sUrl, "", "text/plain", gsuser, gspass);
|
||||||
|
return result != null;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean removeLayerGroup(String name) {
|
public boolean removeLayerGroup(String name) {
|
||||||
try {
|
try {
|
||||||
URL deleteUrl = new URL(restURL + "/rest/layergroups/" + name);
|
URL deleteUrl = new URL(restURL + "/rest/layergroups/" + name);
|
||||||
@ -687,6 +693,7 @@ public class GeoServerRESTPublisher {
|
|||||||
if (!deleted) {
|
if (!deleted) {
|
||||||
LOGGER.warn("Could not delete layergroup " + name);
|
LOGGER.warn("Could not delete layergroup " + name);
|
||||||
} else {
|
} else {
|
||||||
|
if (LOGGER.isInfoEnabled())
|
||||||
LOGGER.info("Layergroup successfully deleted: " + name);
|
LOGGER.info("Layergroup successfully deleted: " + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,41 @@ public class NestedElementEncoder extends XmlElement {
|
|||||||
super(listName);
|
super(listName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(String key, String value) {
|
public void set(final String key, final String value) {
|
||||||
|
final Element entryElem = new Element("entry");
|
||||||
|
|
||||||
|
if (key != null) {
|
||||||
|
entryElem.setAttribute("key", key);
|
||||||
|
}
|
||||||
|
entryElem.setText(value);
|
||||||
|
|
||||||
|
final Element el = contains(entryElem);
|
||||||
|
if (el != null) {
|
||||||
|
addContent(entryElem);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(final String key, final Element value) {
|
||||||
|
final Element entryElem = new Element("entry");
|
||||||
|
|
||||||
|
if (key != null) {
|
||||||
|
entryElem.setAttribute("key", key);
|
||||||
|
}
|
||||||
|
entryElem.addContent(value);
|
||||||
|
|
||||||
|
final Element el = contains(entryElem);
|
||||||
|
|
||||||
|
if (el != null) {
|
||||||
|
addContent(entryElem);
|
||||||
|
} else {
|
||||||
|
if (remove(el))
|
||||||
|
addContent(entryElem);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(final String key, final String value) {
|
||||||
final Element entryElem = new Element("entry");
|
final Element entryElem = new Element("entry");
|
||||||
|
|
||||||
if (key != null)
|
if (key != null)
|
||||||
@ -84,7 +118,7 @@ public class NestedElementEncoder extends XmlElement {
|
|||||||
this.addContent(entryElem);
|
this.addContent(entryElem);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(String key, Element value) {
|
public void add(final String key, final Element value) {
|
||||||
final Element entryElem = new Element("entry");
|
final Element entryElem = new Element("entry");
|
||||||
if (key != null)
|
if (key != null)
|
||||||
entryElem.setAttribute("key", key);
|
entryElem.setAttribute("key", key);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user