java - common io copyUrlToFile not working -



java - common io copyUrlToFile not working -

i trying phone call web service homecoming csv file. each url phone call has suffix string says csv generate. want save csv file. there many generated calling class multiple threads. every time run programme amount of files returned upon completion different amount. webservice running fine because if manually phone call url browser did not create file, csv generated , downloaded. in total there 15,000 url's called 12 threads. receive no errors in output console, says build successful. 1500-2000 files generated each run instead of 15000. using apache's mutual io fileutils library save url file.

final int maxretries = 5; historywebservice historyws = new historywebservice(); string history = historyws.gethistory(maxretries); public class historywebservice { public string gethistory(int maxretries, string str) throws exception { maxretries = math.max(0, maxretries); //make sure don't have negative retry counter while (maxretries >= 0) { seek { fileutils.copyurltofile("http://myservice.myservice/" + str, "/tmp/file" + str); } catch(<catch timeout exception>) { maxretries--; } } throw new timeoutexception("max retries exceeded"); } }

it open files allowed on ubuntu 14.04. default 2096 command ulimit -n 100000 running fine.

java multithreading java-8 apache-commons ubuntu-14.04

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -