Java – how do I download new files only from the server?

I have many CSV files that I want to download from Yahoo Finance every day I want my application to read the creation date of the file (on my computer, not on the server) If the creation date is earlier than today, you should download the new file (because it will have new data) If not, the new file should not be downloaded and the relevant calculator (basically my application) should use the last downloaded file as a specific stock code

I did some Google searches and found the Apache POI project

This is the best way. There is a better way. What would you recommend? Does it matter if JNI is here?

Solution

Would you consider creating an FTP account to access this particular folder and then synchronizing the local folder with the remote folder using an FTP client such as SmartFTP or FileZilla? It should be easy to set up and easy to use... In addition, you can simply create an FTP command script and execute it from Java code, if absolutely necessary

Or I'll try to point in another direction: MD5 () or other message summarization algorithms can help you You don't have to rely on time stamps Try to calculate the MD5 () hash of the file you own and the file you want to download Then you know whether to download it

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>