Create the parent caching directory.

@param cache
@throws VictimsException
517974
protected void create(File cache) throws VictimsException {
        try {
            FileUtils.forceMkdir(cache);
        } catch (IOException e) {
            throw new VictimsException("Could not create an on disk cache", e);
        }
    }
1092584
@Override
    public ICodeBaseLocator createNestedArchiveCodeBaseLocator(ICodeBase parentCodeBase, String path) {
        return new NestedZipFileCodeBaseLocator(parentCodeBase, path);
    }
34828
public function set(Cache $cache, $userName)
    {
        if (!is_writable(dirname($this->getCacheFile($userName)))) {
            throw new CacheException('Cache folder is not writable');
        }

        $data   = serialize($cache);
        $handle = fopen($this->getCacheFile($userName), 'w+');

        fwrite($handle, $data);
        fclose($handle);
    }
792940
void overrideCacheFile(File newCacheFile)
  {
    this.cacheFile = newCacheFile;
    this.cacheDir = newCacheFile.getParentFile();
    this.baseCacheFileName = newCacheFile.getName();
  }
484153
public void addServerToCache(ServerImpl server) {
        // Remove in case, there's an old instance in cache
        removeServerFromCache(server.getId());

        nonReadyServers.put(server.getId(), server);
        server.addServerReadyConsumer(s -> {
            nonReadyServers.remove(s.getId());
            removeUnavailableServerFromCache(s.getId());
            servers.put(s.getId(), s);
        });
    }
639806
public static void setInstance(Cache cache) throws GuildWars2Exception {
		if (instance != null)
			throw new GuildWars2Exception(ErrorCode.Other, "Instance already initialized");
		instance = new GuildWars2(cache);
	}
1066877
private static void addCacheInfoUpdate(CacheStatus cacheStatus) {
    long cacheSize = cacheStatus.size;
    synchronized (baseDirSize) {
      Long dirSize = baseDirSize.get(cacheStatus.getBaseDir());
      if( dirSize == null ) {
        dirSize = Long.valueOf(cacheSize);
      } else {
        dirSize += cacheSize;
      }
      baseDirSize.put(cacheStatus.getBaseDir(), dirSize);
    }
    synchronized (baseDirNumberSubDir) {
      Integer dirSubDir = baseDirNumberSubDir.get(cacheStatus.getBaseDir());
      if( dirSubDir == null ) {
        dirSubDir = 1;
      } else {
        dirSubDir += 1;
      }
      baseDirNumberSubDir.put(cacheStatus.getBaseDir(), dirSubDir);
    }
  }
895287
public static void createParentDirectoryIfNecessary(final File file) {
        final File parentDirectory = file.getParentFile();
        if (parentDirectory == null || parentDirectory.mkdirs() || parentDirectory.exists()) {
            return;
	}
        throw new SdkClientException("Unable to create directory in the path: " + parentDirectory.getAbsolutePath());
    }
533645
private void createReadCaches() {
		recalculateSizeReadCaches();
		if (log.isDebugEnabled()) {
			log.debug(this.getClass().getName() + "::createReadCaches readCacheInternal=" + readCacheInternal
					+ " readCacheLeaf=" + readCacheLeaf);
		}
		cacheInternalNodes = createCacheLRUlinked(readCacheInternal);
		cacheLeafNodes = createCacheLRUlinked(readCacheLeaf);
	}
283220
private synchronized void initCache() {

    if (this.cache == null) {
      ClasspathFolder rootFolder = new ClasspathFolder(null, "");
      Set<String> resourceNames = this.reflectionUtil.findResourceNames("", true, ConstantFilter.getInstance(true));
      List<ClasspathFile> fileList = new ArrayList<>(resourceNames.size());
      for (String resource : resourceNames) {
        ResourcePathNode<Void> path = ResourcePathNode.create(resource);
        ClasspathFolder parent = createFolderRecursive(path.getParent(), rootFolder);
        ClasspathFile file = new ClasspathFile(parent, path.getName());
        parent.children.add(file);
        fileList.add(file);
      }
      this.cache = new Cache(rootFolder, fileList);
    }
  }
30682
@Override
	protected void resetCache() {
		super.resetCache();
		cacheProperties.put(JawrConstant.SASS_GENERATOR_URL_MODE,
				useAbsoluteURL ? SASS_GENERATOR_ABSOLUTE_URL_MODE : SASS_GENERATOR_RELATIVE_URL_MODE);
	}
1144521
<K, V> Cache<K, V> createCache() {
    return CacheBuilder.newBuilder()
        .maximumSize(cacheMaxSize)
        .expireAfterWrite(cacheTtlSeconds, TimeUnit.SECONDS)
        .ticker(cacheTicker)
        .build();
  }
306905
public Cache createCache(String name) throws CacheException {
		SynchronizedCacheConfiguration config = new SynchronizedCacheConfiguration();
		return createCache(name, config, Cache.SYN_CACHE);
	}
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();
    }
1141708
public static Cache createDefaultCache(Context context) {
    File dir = defaultCacheDir(context);
    return new Cache(dir, calculateDiskCacheSize(dir));
  }
458731
public function setCache($cache, $namespace = null)
    {
        if($cache && ObjectRegistryCache::isSupported())
        {
            $this->__registry = new ObjectRegistryCache();

            if($namespace) {
                $this->__registry->setNamespace($namespace);
            }
        }
        else
        {
            if(!$this->__registry instanceof ObjectRegistry) {
                $this->__registry = new ObjectRegistry();
            }
        }

        return $this;
    }
1276478
protected Cache createCache() throws IOException {
        // this factory creates only one single cache and return it if someone invoked this method twice or
        // more
        if (cache != null) {
            throw new IllegalStateException(String.format("This factory has already created memcached client for cache %s", cacheName));
        }

        if (isCacheDisabled()) {
            LOGGER.warn("Cache {} is disabled", cacheName);
            cache = (Cache) Proxy.newProxyInstance(Cache.class.getClassLoader(), new Class[] { Cache.class },
                    new DisabledCacheInvocationHandler(cacheName, cacheAliases));
            return cache;
        }

        if (configuration == null) {
            throw new RuntimeException(String.format("The MemcachedConnectionBean for cache %s must be defined!", cacheName));
        }

        List<InetSocketAddress> addrs = addressProvider.getAddresses();
        cache = new CacheImpl(cacheName, cacheAliases, createClient(addrs), defaultSerializationType, jsonTranscoder, javaTranscoder,
                customTranscoder, new CacheProperties(configuration.isUseNameAsKeyPrefix(), configuration.getKeyPrefixSeparator()));

        return cache;
    }