PackedDatabase getCachedDB(ResourceFile packedDbFile, TaskMonitor monitor)
			throws CancelledException, IOException {
		if (!isEnabled()) {
			throw new IOException("Cache disabled");
		}
		if (!lock.createLock(PackedDatabase.LOCK_TIMEOUT, true)) {
			throw new IOException("Packed database cache timeout");
		}
		try {
			boolean isReadOnly =
				PackedDatabase.isReadOnlyPDBDirectory(packedDbFile.getParentFile());

			LockFile packedDbLock = null;
			if (!isReadOnly) {
				packedDbLock = PackedDatabase.getFileLock(packedDbFile.getFile(false));
				PackedDatabase.lock(packedDbLock, true, true);
			}
			try {
				String packedFilePath = packedDbFile.getCanonicalPath();
				long now = (new Date()).getTime();
				CachedDB cachedDb = null;
				List<CachedDB> list = readCache();
				for (CachedDB entry : list) {
					if (packedFilePath.equals(entry.packedDbFilePath)) {
						if (!entry.dbDir.canExecute() || !entry.dbDir.canWrite()) {
							throw new IOException("Permssion denied: " + entry.dbDir);
						}
						entry.lastAccessTime = now;
						writeCacheList(list);
						cachedDb = entry;
						break;
					}
				}
				if (cachedDb == null) {
					cachedDb = createCachedDb(packedDbFile);
					cachedDb.lastAccessTime = now;
					addCacheMapEntry(cachedDb);
					Msg.debug(this, "Caching packed database: " + cachedDb.packedDbFilePath);
				}
				else {
					Msg.debug(this, "Using cached packed database: " + cachedDb.packedDbFilePath);
				}
				return new PackedDatabase(cachedDb, packedDbFile, packedDbLock, monitor);
			}
			finally {
				if (packedDbLock != null && packedDbLock.haveLock()) {
					// packed database lock may have been removed if disposed on error
					packedDbLock.removeLock();
				}
			}
		}
		finally {
			lock.removeLock();
		}
	}
Get cached packed database
@param packedDbFile
@param isReadOnly
@param monitor
@return
@throws CancelledException
@throws IOException
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/db/PackedDatabaseCache.java