This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Process JSON file on filesystem using a GET? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Process JSON file on filesystem using a GET? " Watch "Process JSON file on filesystem using a GET? " New topic
Author

Process JSON file on filesystem using a GET?

James Dekker
Ranch Hand

Joined: Dec 09, 2006
Posts: 215
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

Joined: Oct 31, 2012
Posts: 9
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
Marshal

Joined: Mar 22, 2005
Posts: 39535
    
  27
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)".


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Process JSON file on filesystem using a GET?
 
Similar Threads
ContentNegotiatingViewResolver
can One webapp contain Spring MVC and Spring RESTFul services
JavaFx and RESTFul services
Why is there still interest in (and lots of questions about) RMI?
call json data in Jquery