} catch (Exception e) {
logger.fine("Cache miss for " + cachedUri + " : " + e.getMessage());
}
}
final FileInfo fileInfo = transport.get(uri);
final byte[] content = fileInfo.getContent();
FileOutputStream outputStream = null;
final File file = new File(cachedUri.getPath());
try {
file.getParentFile().mkdirs();
outputStream = new FileOutputStream(file);
outputStream.write(content, 0, content.length);
} catch (Exception e) {
logger.warning("Couldn't update file cache for " + cachedUri);
} finally {
IOUtils.silentClose(outputStream);
}
file.setLastModified(fileInfo.getLastModified());
reader.touch(cachedUri, fileInfo.getLastModified());
return fileInfo;
}