Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Process JSON file on filesystem using a GET?

 
James Dekker
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Jersey & Jackson to process Restful based web services with JSON.

Lets say that I have json text files (e.g. customer.json) that reside on a filesystem...

Is it possible to process that json file from a Restful method which implements @GET?

Would I need to upload the file using Java's File I/O inside the @GET method?

Any help will be greatly appreciated...
 
Abhijit Durge
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello James,

Lets say that I have json text files (e.g. customer.json) that reside on a filesystem...

Does customer.json reside on client machine or server machine.

Is it possible to process that json file from a Restful method which implements @GET?

If the file is a response to a GET request then processing of the JSON is possible on the @GET method.

Would I need to upload the file using Java's File I/O inside the @GET method?

If the file is on server machine/location which is accessible on the net, and the json is a response to be sent back to the client then its possible

--
Regards,
Abhijit
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's unclear to me where the file is. If it is to be uploaded from the client as part of the request, then using GET is not possible, because the upload is a POST request.

And yes, JAX-RS/Jersey can accept file upload requests via "@POST @Consumes(MediaType.MULTIPART_FORM_DATA)".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic