This code base is modified from one of my school project.
Features:
-
JavaFX GUI
-
Data caching
-
Multi-threading
To run this project, simply do:
$ gradle run --args="<online/offline> <online/offline>"
with the first controlling the input API, and the second controlling the output API.
API | Online | Offline |
---|---|---|
Input | Real information coming from IP Geolocation | Mock API for testing purpose |
Output | PasteBin | Command-line Text Output |
Please create a valid .env before running any testcases and using the application in online mode (for both input and output APIs), some may fail due to FileNotFoundException.
Create a .env
file under src/main/resources/
with:
IP_API_KEY=<your_key>
PASTEBIN_API_KEY=<your_key>
The database is for caching purpose.
cache.db
is located under src/main/resources
. By default, it is empty.
Schema:
sqlite> .schema
CREATE TABLE cache (ip string, json string);
init.sql
in the same directory is provided for re-generating the database. To reset simply run:
$ rm cache.db
$ sqlite3 cache.db < init.sql
GET/POST https://square.github.io/okhttp/