简体   繁体   中英

Storing downloaded files in Java

I have a java application that I am developing that displays pictures from the website it is made to supplement. Now I would like to save some bandwidth, so what I have done is made a created a php script that md5 hashes the images and then my java captures the output and then compares it against hashes stored using the preferences api. What I would now like is for the images to be stored on the computer, Windows or Mac, and be there for when I run the program again. I've looked around for stuff on caching, but can't seem to find anything relevant to what I am doing. If I can't find anything I will just write my own for it, but a premade api would be great. Thanks

Any static content do carry expiration headers[ aka E-Tags ] . While fetching the image from remote repository it might also be possible to fetch expiration headers accordingly.

Example Header : Expires: Thu, 15 Apr 2010 20:00:00 GMT

Thus they could save, much effort in re-verifying the meta-data of image file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM