Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

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.is_cached("label")) {
    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

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages