I am consuming data from url and stored in "output" string.
How to convert that into java object and separate fields ?
Here is my code :
Client client = Client.create();
WebResource webResource = client
.resource(url);
String name = "xxx";
String password = "xxx";
String authString = name + ":" + password;
String authStringEnc = new BASE64Encoder().encode(authString
.getBytes());
//System.out.println("Base64 encoded auth string: " + authStringEnc);
ClientResponse response = webResource.accept("application/json")
.header("Authorization", "Basic " + authStringEnc)
.get(ClientResponse.class);
String output = response.getEntity(String.class);
System.out.println("Output from Server .... \n");
System.out.println(output);