Skip to content

CacheToFile is a java library to cache your data. This library store your java object in to file system.so no worry about loss your data when server is restarted.

License

Notifications You must be signed in to change notification settings

mukeshdabhi/CacheToFile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CacheToFile

CacheToFile is a java library to cache your data. This library store your java object in to file system.so no worry about loss your data when server is restarted.

How to use

Create object :

private CacheToFile cacheToFile = new CacheToFile("/Users/administrator/Downloads");

if (cacheToFile.has("you key")) {
  out.println(cacheToFile.get("your key"));
  out.println("From cache");
} else {
 //Some long operation 
 boolean cached = cacheToFile.put("your key", <your object>, <Cache unit>, <Unit value>);
}
 
out.println(cacheToFile.get("your key"));
out.println("From not cache");
}

Cache unit

  1. CacheToFile.unit.DAY
  2. CacheToFile.unit.HOUR
  3. CacheToFile.unit.MINUTE

Unit value

Provide valid Integer value

About

CacheToFile is a java library to cache your data. This library store your java object in to file system.so no worry about loss your data when server is restarted.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published