}
Form form = req.getEntityAsForm();
if (form == null) {
throw new RestletException("Unable to parse form result.",
Status.CLIENT_ERROR_BAD_REQUEST);
}
// String layerName = form.getFirst("layerName").getValue();
TileLayer tl = null;
try {
tl = seeder.findTileLayer(layerName);
} catch (GeoWebCacheException e) {
throw new RestletException(e.getMessage(), Status.CLIENT_ERROR_BAD_REQUEST);
}
if (form.getFirst("kill_thread") != null) {
handleKillThreadPost(form, tl, resp);
} else if (form.getFirst("kill_all") != null) {
handleKillAllThreadsPost(form, tl, resp);
} else if (form.getFirst("minX") != null) {
handleDoSeedPost(form, tl, resp);
} else {
throw new RestletException(
"Unknown or malformed request. Please try again, somtimes the form "
+ "is not properly received. This frequently happens on the first POST "
+ "after a restart. The POST was to " + req.getResourceRef().getPath(),
Status.CLIENT_ERROR_BAD_REQUEST);
}