private void readIndex() throws IndexReadException {

		// TODO: current implementation does not attempt to avoid concurrent read/write
		// access to index/journal files

		MessageDigest messageDigest = null;
		try {
			messageDigest = MessageDigest.getInstance("MD5");
		}
		catch (NoSuchAlgorithmException e) {
			throw new RuntimeException(e.toString());
		}

		if (rootFolder != null) {
			// help-out the garbage collector by clearing references
			dispose(rootFolder);
		}
		rootFolder = new Folder();

		String md5Str = null;
		String idLine = null;
		BufferedReader indexReader = null;
		try {
			indexReader = new BufferedReader(new InputStreamReader(
				new BufferedInputStream(new FileInputStream(indexFile)), "UTF8"));
			String line = indexReader.readLine();
			if (checkIndexVersion(line)) {
				// version line consumed - read next line
				line = indexReader.readLine();
			}
			Folder currentFolder = null;
			while (line != null) {
				if (line.startsWith(MD5_PREFIX)) {
					// should be last line in file
					md5Str = line.substring(MD5_PREFIX.length());
				}
				else if (line.startsWith(NEXT_FILE_INDEX_ID_PREFIX)) {
					// should immediately proceed MD5 line
					md5Str = null;
					digest(line, messageDigest);
					idLine = line.substring(NEXT_FILE_INDEX_ID_PREFIX.length());
				}
				else {
					md5Str = null;
					idLine = null;
					if (line.startsWith(SEPARATOR)) {
						digest(line, messageDigest);
						currentFolder = getFolder(line, GetFolderOption.CREATE);
					}
					else {
						String entry = line.substring(INDEX_ITEM_INDENT.length());
						digest(entry, messageDigest);
						if (parseIndexItem(currentFolder, entry) == null) {
							throw new IOException("Invalid filesystem index: " + indexFile);
						}
					}
				}
				line = indexReader.readLine();
			}
		}
		catch (Exception e) {
			if (e instanceof IndexVersionException) {
				throw (IndexVersionException) e;
			}
			throw new IndexReadException("Filesystem Index error: " + indexFile, e);
		}
		finally {
			if (indexReader != null) {
				try {
					indexReader.close();
				}
				catch (IOException e) {
					// ignore
				}
			}
		}

		try {
			nextFileIndexID = NumericUtilities.parseHexLong(idLine);
		}
		catch (Exception e) {
			throw new IndexReadException("Invalid Filesystem Index (NEXT-ID): " + indexFile);
		}

		String md5Digest = NumericUtilities.convertBytesToString(messageDigest.digest());
		if (md5Str == null || !md5Str.equals(md5Digest)) {
			throw new IndexReadException("Invalid Filesystem Index (MD5): " + indexFile);
		}
	}
Attempt to parse index version
@param firstIndexLine
@return index version or -1 if index version unknown
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/local/IndexedLocalFileSystem.java