public Cache() {
    	try {
	        File[] files = new File(Constants.getCacheDirectory()).listFiles();
	        dataFile = findDataFile(files);
	        indexFiles = findIndexFiles(files);
	        java.util.Arrays.sort(indexFiles);
	        if (dataFile == null) {
	            throw new IOException("Unable to locate cache data file!\nCorrect cache loaded?");
	        }
	        if (indexFiles.length == 0) {
	            throw new IOException("Unable to locate cache index files!\nCorrect cache loaded?");
	        }
	        indices = new ArrayList<CacheIndice>();
	        RandomAccessFile data = new RandomAccessFile(dataFile, "rw");
	        for (int i = 0; i < indexFiles.length; i++) {
	            CacheIndice indice = new CacheIndice(data, new RandomAccessFile(indexFiles[i], "rw"), i+1);
	            indices.add(indice);
	        }
    	} catch (IOException e) {
    		e.printStackTrace();
    	}
    }