JsonNode readCacheFile ( ) { if ( cacheFile == null || ! this . checkCacheLockFile ( ) ) { // no cache or the cache is not valid. return null ; } try { if ( ! cacheFile . exists ( ) ) { LOGGER . debug ( "Cache file doesn't exists. File: {}" , cacheFile ) ; return null ; } try ( Reader reader = new InputStreamReader ( new FileInputStream ( cacheFile ) , DEFAULT_FILE_ENCODING ) ) { return OBJECT_MAPPER . readTree ( reader ) ; } } catch ( IOException ex ) { LOGGER . debug ( "Failed to read the cache file. No worry. File: {}, Err: {}" , cacheFile , ex ) ; } return null ; }
Reads the cache file .