Code example for Cache

Methods: put

0
        if (!cachedFile.isFile()) {
            // Has previously been added to the cache directory 
            GFileUtils.copyFile(source, cachedFile);
        } 
        FileInfo fileInfo = new FileInfo(lastModified, length, hashValue, cachedFile);
        cachedFiles.put(source, fileInfo);
        return fileInfo;
    } 
 
    private static class FileInfo { 
        final long lastModified;
        final long length;
        final HashValue hashValue;
        final File cachedFile;
 
        private FileInfo(long lastModified, long length, HashValue hashValue, File cachedFile) {
            this.lastModified = lastModified;
            this.length = length;
            this.hashValue = hashValue;
            this.cachedFile = cachedFile;
        }