Removes all not active dirs with old caches.
This method is invoked after each save of global plugin config

@param configs active server configs to exclude caches from cleanup
10030
public static void clearRedundantCaches(List<GitHubServerConfig> configs) {
        Path baseCacheDir = getBaseCacheDir();

        if (notExists(baseCacheDir)) {
            return;
        }

        final Set<String> actualNames = from(configs).filter(withEnabledCache()).transform(toCacheDir())
                .transform(cacheToName()).toSet();

        try (DirectoryStream<Path> caches = newDirectoryStream(baseCacheDir, notInCaches(actualNames))) {
            deleteEveryIn(caches);
        } catch (IOException e) {
            LOGGER.warn("Can't list cache dirs in {}", baseCacheDir, e);
        }
    }
1238659
public void dropCaches() {
    if (use_lru) {
      lru_name_cache.invalidateAll();
      lru_id_cache.invalidateAll();
    } else {
      name_cache.clear();
      id_cache.clear();
    }
  }
523579
public void clearCache() {
        File cacheDir = getCacheDir();
        if (cacheDir.exists()) {
            File[] files = cacheDir.listFiles();
            if (files != null) {
                for (File child : files) {
                    deleteFilesRecursively(child);
                }
            }
        }
    }
663552
public function unloadPlugins()
    {
        $this->resetTransientCache();

        $pluginsLoaded = $this->getLoadedPlugins();
        foreach ($pluginsLoaded as $plugin) {
            $this->unloadPlugin($plugin);
        }
    }
340619
public void setDirectories(java.util.Collection<Directory> directories) {
        if (directories == null) {
            this.directories = null;
            return;
        }

        this.directories = new java.util.ArrayList<Directory>(directories);
    }
596542
public void clearAllCaches() {
        logger.warn("beginning request to clear all caches");
        for (final String cacheName : this.cacheManager.getCacheNames()) {
            clearCache(cacheName);
        }
        logger.warn("completed request to clear all caches");
    }
615431
def clean(config):
    
    if not exists(config):
        logger.debug("Wily cache does not exist, skipping")
        return
    shutil.rmtree(config.cache_path)
    logger.debug("Deleted wily cache")
889530
public static function removeDirectories($directories = null)
	{
		if (is_null($directories))
		{
			static::$directories = array();
		}
		else
		{
			static::$directories = array_diff(static::$directories, (array) $directories);
		}
	}
432647
public function clearAll()
    {
        /**
         * @var Settings settings
         */
        $settings = FastcgiCacheBust::$plugin->getSettings();
        if (!empty($settings) && !empty($settings->cachePath)) {
            $cacheDirs = explode(',', $settings->cachePath);
            foreach ($cacheDirs as $cacheDir) {
                $cacheDir = trim($cacheDir);
                try {
                    FileHelper::clearDirectory($cacheDir);
                } catch (ErrorException $e) {
                    Craft::error($e->getMessage(), __METHOD__);
                }
                Craft::info(
                    Craft::t(
                        'fastcgi-cache-bust',
                        'FastCGI Cache busted: `'.$cacheDir
                    ),
                    __METHOD__
                );
            }
        }
    }
1182516
public void clear(NewRelicCache cache)
    {
        if(cache == null)
            throw new IllegalArgumentException("null cache");
        cache.applications().clear();
        cache.browserApplications().clear();
        cache.mobileApplications().clear();
        cache.plugins().clear();
        cache.monitors().clear();
        cache.servers().clear();
        cache.entities().clear();
        cache.alertPolicies().clear();
        cache.alertChannels().clear();
        cache.dashboards().clear();
    }
1131159
public function clearCacheCommand($parameters)
    {
        if (in_array($parameters['cacheCmd'], ['all', 'system'])) {
            $files = $this->getFilesInPath(self::GENERATED_FILES_PATH . '*');

            foreach ($files as $file) {
                $this->clearFile($file);
            }
        }
    }
679939
private static void clean(Config config, Attachment[] attachmentz) {
	if (attachmentz != null) for (int i = 0; i < attachmentz.length; i++) {
	    if (attachmentz[i].isRemoveAfterSend()) {
		Resource res = config.getResource(attachmentz[i].getAbsolutePath());
		ResourceUtil.removeEL(res, true);
	    }
	}
    }
1126831
public function removeLocalesCacheFiles(array $locales)
    {
        foreach ($locales as $locale) {
            $this->removeCacheFile($locale);
        }

        // also remove database.resources.php cache file
        $file = sprintf('%s/database.resources.php', $this->options['cache_dir']);
        if (file_exists($file)) {
            $this->invalidateSystemCacheForFile($file);
            unlink($file);
        }

        $metadata = $file.'.meta';
        if (file_exists($metadata)) {
            $this->invalidateSystemCacheForFile($metadata);
            unlink($metadata);
        }
    }
1334643
public void clear(Collection keys) {
		synchronized (mirror) {
			synchronized (data) {
				Iterator i = keys.iterator();
				while (i.hasNext()) {
					Object key = i.next();
					data.remove(key);
					mirror.remove(key);
				}
			}
		}
	}
324472
public void deleteByKey(List<DatastoreKey> keys) {
    try {
      Key[] nativeKeys = new Key[keys.size()];
      for (int i = 0; i < keys.size(); i++) {
        nativeKeys[i] = keys.get(i).nativeKey();
      }
      nativeWriter.delete(nativeKeys);
    } catch (DatastoreException exp) {
      throw DatastoreUtils.wrap(exp);
    }
  }
856147
public void removeFromCache(Set<String> rootPaths, boolean online) {

        Map<String, Boolean> cache;
        if (online) {
            cache = m_onlineJsps;
        } else {
            cache = m_offlineJsps;
        }
        Iterator<String> itRemove = rootPaths.iterator();
        while (itRemove.hasNext()) {
            String rootPath = itRemove.next();
            cache.remove(rootPath);
        }
    }
1047049
public static synchronized void clear() {
        for (final Map.Entry<String, Cache> entry : CACHES.entrySet()) {
            final Cache cache = entry.getValue();
            cache.clear();
            LOGGER.log(Level.TRACE, "Cleared cache [name={0}]", entry.getKey());
        }
    }