Using Jersey/JAX-RS I have a get handler that contains code to copy a large file to another location. I want to be able to go to a URL and be able to see the current state of the copying (i.e. time elapsed). How do I accomplish this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
On which side? The sender or the receiver?
The sender could expose a link or something, as part of the request.
You could arguably do something like
POST receiver/foo/incoming
receiver might ‘201 Created’ or ‘303 See Other’ sender to the URI receiver/foo/1
at this time, a
GET receiver/foo/1
might simply return the provided status link, or embed it in the representation:
GET sender/foo/abc/status
Might return, at this time, “pending” or “queued” or something like that.
…
Then, sender is free to
PUT receiver/foo/1
During the PUT, async GET to the services can still GET the status from the origin service, which might now be “transmitting” or include the bytes/total, etc.