}
return task;
}
void handleTaskPut() {
ImportTask orig = (ImportTask) lookupTask(false);
ImportTask task;
try {
task = (ImportTask) getFormatPostOrPut().toObject(getRequest().getEntity());
} catch (ValidationException ve) {
getLogger().log(Level.WARNING, null, ve);
throw ImportJSONWriter.badRequest(ve.getMessage());
}
boolean change = false;
if (task.getStore() != null) {
//JD: moved to TaskTargetResource, but handle here for backward compatability
TaskTargetResource.updateStoreInfo(orig, task.getStore(), importer);
change = true;
}
if (task.getData() != null) {
//TODO: move this to data endpoint
orig.getData().setCharsetEncoding(task.getData().getCharsetEncoding());
change = true;
}
if (task.getUpdateMode() != null) {
orig.setUpdateMode(task.getUpdateMode());
change = orig.getUpdateMode() != task.getUpdateMode();
}
if (task.getLayer() != null) {
change = true;
//now handled by LayerResource, but handle here for backwards compatability
LayerResource.updateLayer(orig, task.getLayer(), importer);
}
TransformChain chain = task.getTransform();
if (chain != null) {
orig.setTransform(chain);
change = true;
}