@ Override protected synchronized void checkDataMaps ( ) throws IOException { if ( lastUpdateCheck == 0 || lastUpdateCheck < System . currentTimeMillis ( ) - updateInterval ) { String versionOnServer = getVersionFromServer ( ) ; if ( currentVersion == null || versionOnServer . compareTo ( currentVersion ) > 0 ) { loadDataFromInternetAndSave ( ) ; loadDataFromFile ( getCacheFile ( ) ) ; currentVersion = versionOnServer ; prop . setProperty ( "currentVersion" , currentVersion ) ; } lastUpdateCheck = System . currentTimeMillis ( ) ; prop . setProperty ( "lastUpdateCheck" , Long . toString ( lastUpdateCheck ) ) ; saveProperties ( prop ) ; } }
This implementation uses a local properties file to keep the lastUpdate time and the local data file version