public static LocalFileSystem getLocalFileSystem(String rootPath, boolean create,
			boolean isVersioned, boolean readOnly, boolean enableAsyncronousDispatching)
			throws IOException {

		File root = new File(rootPath);
		if (!root.isDirectory()) {
			throw new IOException("filesystem directory not found: " + rootPath);
		}
		if (create && root.list().length != 0) {
			throw new IOException("new filesystem directory is not empty: " + rootPath);
		}
		if (create) {
//			if (isCreateMangledFileSystemEnabled()) {
//				return new MangledLocalFileSystem(rootPath, isVersioned, readOnly,
//					enableAsyncronousDispatching);
//			}
			return new IndexedV1LocalFileSystem(rootPath, isVersioned, readOnly,
				enableAsyncronousDispatching, true);
		}
		else if (!readOnly && !root.canWrite()) {
			throw new IOException("filesystem directory is not writable: " + rootPath);
		}

		int indexVersion = -1;
		if (IndexedLocalFileSystem.isIndexed(rootPath)) {
			indexVersion = IndexedLocalFileSystem.readIndexVersion(rootPath);
		}
		else if (IndexedLocalFileSystem.hasIndexedStructure(rootPath)) {
			// assume latest version - index file missing, rebuild required
			indexVersion = IndexedLocalFileSystem.LATEST_INDEX_VERSION;
		}

		switch (indexVersion) {
			case -1:
				if (hasAnyHiddenFiles(root)) {
					throw new IOException("Unsupported file system schema: " + rootPath);
				}
				// Use legacy mangled filesystem if existing data does not appear to be indexed
				Msg.warn(LocalFileSystem.class, "Using deprecated Mangled filesystem: " + rootPath);
				return new MangledLocalFileSystem(rootPath, isVersioned, readOnly,
					enableAsyncronousDispatching);
			case 0:
				Msg.warn(LocalFileSystem.class,
					"Using deprecated Indexed filesystem (V0): " + rootPath);
				return IndexedLocalFileSystem.getFileSystem(rootPath, isVersioned, readOnly,
					enableAsyncronousDispatching);
			case 1:
				return IndexedV1LocalFileSystem.getFileSystem(rootPath, isVersioned, readOnly,
					enableAsyncronousDispatching);
			default:
				throw new IOException(
					"Unsupported file system version (" + indexVersion + "): " + rootPath);
		}
	}
Construct a local filesystem for existing data
@param rootPath
@param create
@param isVersioned
@param readOnly
@param enableAsyncronousDispatching
@return local filesystem
@throws FileNotFoundException if specified rootPath does not exist
@throws IOException if error occurs while reading/writing index files
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/local/LocalFileSystem.java