/** * Initializes the cache. * * @param maxSizeStr the maximum size of the cache (as a String) * @param maxCountStr the maximum number of files in the cache * @param minAgeStr the minimum age of a file in the cache to be eligible for removal (in seconds) * @param fileStorage the file storage mechanism to use to store and fetch files * @see SizeUtils#parseSizeInBytes(String) * @since 7.10-HF03, 8.1 */ public void initializeCache(String maxSizeStr, String maxCountStr, String minAgeStr, FileStorage fileStorage) throws IOException { cachedir = Framework.createTempFile("nxbincache.", ""); cachedir.delete(); cachedir.mkdir(); long maxSize = SizeUtils.parseSizeInBytes(maxSizeStr); long maxCount = Long.parseLong(maxCountStr); long minAge = Long.parseLong(minAgeStr); initializeCache(cachedir, maxSize, maxCount, minAge, fileStorage); log.info("Using binary cache directory: " + cachedir.getPath() + " size: " + maxSizeStr + " maxCount: " + maxCount + " minAge: " + minAge); // be sure FileTracker won't steal our files ! FileEventTracker.registerProtectedPath(cachedir.getAbsolutePath()); }