简体   繁体   中英

Custom caching of xml and properties file in java?

I want write a class which is use to cache xml and properties file for certain interval and cache should be updated in next same request if there ll be any change in source.

so can any one tell me how to achieve this?

Create class that parses data and exposes interface to get the data. Let's call the method getProperty() . You can create member variable Date lastUpdated . Every time you call getProperty() you check whether the timeout is already expired. If it is you read data from file. Otherwise you just return the data.

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