• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Process JSON file on filesystem using a GET?

 
Ranch Hand
Posts: 231
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)".
 
What a show! What atmosphere! What fun! What a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic