8000 GitHub - HiddenMotives/Java-SimpleCache at 1.0
[go: up one dir, main page]

Skip to content

HiddenMotives/Java-SimpleCache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Java SimpleCache

The Java SimpleCache Class is an easy way to cache 3rd party API calls.

Usage

A very basic usage example:

SimpleCache cache = new SimpleCache();
String data = cache.get_data("label", "http://some.api.com/file.json");
System.out.println(data);

A more advanced example:

SimpleCache cache = new SimpleCache();
cache.set_cache_time(3);
cache.set_cache_path("cache/");	
cache.set_cache_extension(".json");

String data = null;

if(cache.get_cache("label") != null) {
    data = cache.get_cache("label");
} else {
    data = cache.grab_url("http://some.api.com/file.json");
    cache.set_cache("label", data);
}

System.out.println(data);

Credits

SimpleCache Caching Class Originally published in PHP by Gilbert Pellegrom. Ported to Java by me :)

About

A simple file based caching library for caching 3rd party API calls in Java.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0