public static void cleanupOldTempDatabases() {

		File tmpDir = Application.getUserTempDirectory();
		File[] tempDbs = tmpDir.listFiles((FileFilter) file -> {
			String name = file.getName();
			if (file.isDirectory()) {
				if (name.indexOf(TEMPDB_DIR_PREFIX) == 0 && name.endsWith(TEMPDB_DIR_EXT)) {
					return true;
				}
			}
			return false;
		});
		if (tempDbs == null) {
			return;
		}

		// We really have no way of identifying an in-use unpacked database
		// so we must give lots of room before removing one (i.e., one week)
		long lastWeek = (new Date()).getTime() - ONE_WEEK_MS;

		for (File tempDb : tempDbs) {
			try {
				if (tempDb.isDirectory() && tempDb.lastModified() <= lastWeek) {
					if (FileUtilities.deleteDir(tempDb)) {
						Msg.info(PackedDatabase.class, "Removed temporary database: " + tempDb);
					}
				}
			}
			catch (Exception e) {
				// ignore
			}
		}

	}
Attempt to remove all old temporary databases.  This method is not intended for general use 
and should only be invoked once during module initialization 
(see {@link FileSystemInitializer}).
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/db/PackedDatabase.java