This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
It sounds like a RESTful web service could be a good fit for you. I am not entirely sure I have understood all of your requirements, but I'll make an attempt:
Lets assume all your documents are found under the /documents resource.
If a client performs a GET on the /documents resource root, then a list of PDF documents adhering to your size requirement is produced with URIs to each document in the list.
If the client performs a GET on a specific /documents resource, then the appropriate PDF document is downloaded.
Please do not hesitate to ask if I have been unclear!
@shivendra I wrote a plain logic for it & my eclipse ide has made fine wsdl for me.
@Ivan I am using Apache Axis web service for it. My question is that I want to collect files of total 1 mb from specific folder.
Here is my code to retrieve that. I am easily getting that.
Now my question is
1. If the web service is called how can I know that it first call or second call.i.e if when server has started first time the web service is called,if after some time web service is called second time how can I track that.
2. How to track that this many files are send to client & next are remaining.i.e if in first call I send total of 4 files(having 1 mb of size),then in second call I have to send files from 5th file upto my required size.
Can you please help in this.
Please ask me if it not clear.
Thanks for reply.
Joined: Oct 04, 2006
Since you are already using the file system, you can use lock file(s).
Files can be created atomically using File.createNewFile() and you can use some appropriate naming scheme to be able to make the decisions you need to make.