Index: ivy/ivy.xml
===================================================================
--- ivy/ivy.xml (revision 1669851)
+++ ivy/ivy.xml (working copy)
@@ -71,14 +71,15 @@
-
-
-
-
-
+
+
+
+
+
-
+
+
Index: src/java/org/apache/nutch/service/NutchServer.java
===================================================================
--- src/java/org/apache/nutch/service/NutchServer.java (revision 1669851)
+++ src/java/org/apache/nutch/service/NutchServer.java (working copy)
@@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.List;
+import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.OptionBuilder;
@@ -36,7 +37,6 @@
import org.apache.nutch.service.impl.ConfManagerImpl;
import org.apache.nutch.service.resources.ConfigResource;
import org.apache.nutch.service.resources.JobResource;
-import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Index: src/java/org/apache/nutch/service/resources/ConfigResource.java
===================================================================
--- src/java/org/apache/nutch/service/resources/ConfigResource.java (revision 1669851)
+++ src/java/org/apache/nutch/service/resources/ConfigResource.java (working copy)
@@ -28,13 +28,13 @@
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.GenericEntity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.apache.nutch.service.model.request.NutchConfig;
-import org.codehaus.jettison.json.JSONObject;
+import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures;
+import com.fasterxml.jackson.databind.SerializationFeature;
@Path("/config")
public class ConfigResource extends AbstractResource{
@@ -43,18 +43,21 @@
@GET
@Path("/")
+ @JacksonFeatures(serializationEnable = { SerializationFeature.INDENT_OUTPUT })
public Set getConfigs() {
return configManager.list();
}
@GET
@Path("/{configId}")
+ @JacksonFeatures(serializationEnable = { SerializationFeature.INDENT_OUTPUT })
public Map getConfig(@PathParam("configId") String configId) {
return configManager.getAsMap(configId);
}
@GET
@Path("/{configId}/{propertyId}")
+ @JacksonFeatures(serializationEnable = { SerializationFeature.INDENT_OUTPUT })
public String getProperty(@PathParam("configId") String configId,
@PathParam("propertyId") String propertyId) {
return configManager.getAsMap(configId).get(propertyId);
Index: src/java/org/apache/nutch/service/resources/JobResource.java
===================================================================
--- src/java/org/apache/nutch/service/resources/JobResource.java (revision 1669851)
+++ src/java/org/apache/nutch/service/resources/JobResource.java (working copy)
@@ -26,6 +26,8 @@
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.jaxrs.annotation.JacksonFeatures;
import org.apache.nutch.service.model.response.JobConfig;
import org.apache.nutch.service.model.response.JobInfo;
import org.apache.nutch.service.model.response.JobInfo.State;
@@ -35,12 +37,14 @@
@GET
@Path(value = "/")
+ @JacksonFeatures(serializationEnable = { SerializationFeature.INDENT_OUTPUT })
public Collection getJobs(@QueryParam("crawlId") String crawlId) {
return jobManager.list(crawlId, State.ANY);
}
@GET
@Path(value = "/{id}")
+ @JacksonFeatures(serializationEnable = { SerializationFeature.INDENT_OUTPUT })
public JobInfo getInfo(@PathParam("id") String id,
@QueryParam("crawlId") String crawlId) {
return jobManager.get(crawlId, id);