private static void ensureCacheIndexLoaded() {
		if (cacheIndex == null) {
			cacheIndex = new HashMap<String, Boolean>();
			if (GlobalConfiguration.cleanCache) {
				deleteCacheFiles();
				anyNecessaryCacheCleanupDone = true;
			}
			else {
				File cacheDir = new File(GlobalConfiguration.cacheDir, ".slcache");
				cacheDir.mkdir();
				File cacheIndexFile = new File(cacheDir, ".index");
				if (cacheIndexFile.exists()) {
					try {
						boolean clearCache = false;
						int cacheVersion = CACHE_VERSION_1_1_0; // if no version tag, assume 1.1.0
						try {
							FileReader fr = new FileReader(cacheIndexFile);
							BufferedReader br = new BufferedReader(fr);
							String line;
							boolean handledVersionString = false;
							while ((line = br.readLine()) != null) {
								if (!handledVersionString) {
									if (line.startsWith("Version")) {
										int colon = line.indexOf(":");
										if (colon != -1) {
											cacheVersion = Integer.parseInt(line.substring(colon + 1));
										}

										handledVersionString = true;
										continue;
									}
								}
								StringTokenizer st = new StringTokenizer(line, ":");
								boolean changed = st.nextToken().equals("y");
								String len = st.nextToken();
								String classname = st.nextToken();
								String key = new StringBuilder(classname).append("_").append(len).toString();
								// System.out.println("Populating cache index:" + key + "=" + changed);
								cacheIndex.put(key, changed);
							}
							fr.close();
						}
						catch (IOException ioe) {
							ioe.printStackTrace();
						}
						if (cacheVersion != CURRENT_CACHE_VERSION) {
							clearCache = true;
							versionInIndex = false;
						}
						else {
							versionInIndex = true;
						}
						if (clearCache) {
							if (DEBUG_CACHING) {
								System.out.println("SpringLoaded: cache looks old (version " + cacheVersion
										+ ") - clearing it");
							}
							deleteCacheFiles();
							anyNecessaryCacheCleanupDone = true;
						}
					}
					catch (NoSuchElementException nsme) {
						// rogue entry in the cache
						if (DEBUG_CACHING) {
							System.out.println("SpringLoaded: cache corrupt, clearing it");
						}
						deleteCacheFiles();
						anyNecessaryCacheCleanupDone = true;
					}
				}
			}
		}
	}
private static void ensureCacheIndexLoaded ( ) { if ( cacheIndex == null ) { cacheIndex = new HashMap < String , Boolean > ( ) ; if ( GlobalConfiguration . cleanCache ) { deleteCacheFiles ( ) ; anyNecessaryCacheCleanupDone = true ; } else { File cacheDir = new File ( GlobalConfiguration . cacheDir , ".slcache" ) ; cacheDir . mkdir ( ) ; File cacheIndexFile = new File ( cacheDir , ".index" ) ; if ( cacheIndexFile . exists ( ) ) { try { boolean clearCache = false ; int cacheVersion = CACHE_VERSION_1_1_0 ; try { FileReader fr = new FileReader ( cacheIndexFile ) ; BufferedReader br = new BufferedReader ( fr ) ; String line ; boolean handledVersionString = false ; while ( ( line = br . readLine ( ) ) != null ) { if ( ! handledVersionString ) { if ( line . startsWith ( "Version" ) ) { int colon = line . indexOf ( ":" ) ; if ( colon != - 1 ) { cacheVersion = Integer . parseInt ( line . substring ( colon + 1 ) ) ; } handledVersionString = true ; continue ; } } StringTokenizer st = new StringTokenizer ( line , ":" ) ; boolean changed = st . nextToken ( ) . equals ( "y" ) ; String len = st . nextToken ( ) ; String classname = st . nextToken ( ) ; String key = new StringBuilder ( classname ) . append ( "_" ) . append ( len ) . toString ( ) ; cacheIndex . put ( key , changed ) ; } fr . close ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } if ( cacheVersion != CURRENT_CACHE_VERSION ) { clearCache = true ; versionInIndex = false ; } else { versionInIndex = true ; } if ( clearCache ) { if ( DEBUG_CACHING ) { System . out . println ( "SpringLoaded: cache looks old (version " + cacheVersion + ") - clearing it" ) ; } deleteCacheFiles ( ) ; anyNecessaryCacheCleanupDone = true ; } } catch ( NoSuchElementException nsme ) { if ( DEBUG_CACHING ) { System . out . println ( "SpringLoaded: cache corrupt, clearing it" ) ; } deleteCacheFiles ( ) ; anyNecessaryCacheCleanupDone = true ; } } } } }
Load the cache index from the file '&lt;cacheDir&gt;/.index'.