if (getType() == WGDocument.TYPE_FILECONTAINER && _manager.isStrictFCDateDetermination()) {
lastModified = determineFileContainerLastModified();
}
// Check the cache
Cache cache = _manager.getCore().getDesignFileCache();
// We need to include the reference of the current provider here bc. the codefile path itself may be not full-qualified
// (for example when it reflects the path inside a ZIP file)
String cacheKey = _manager.getDesignReference() + "/" + getCodeFile().getName().getPath();
try {
Data cacheData = (Data) cache.readEntry(cacheKey);
if (cacheData != null && cacheData.getLastModified() >= lastModified && cacheData.isMdFileExists() == mdFile.exists() && cacheData.getEncoding().equals(_manager.getFileEncoding())) {
_data = cacheData;
return cacheData;
}
}
catch (CacheException e) {
_manager.getLog().error("Exception checking design cache", e);
}
// Build a new data object and put it to cache
DesignMetadata metadata = (DesignMetadata) readMetaData();
String code = readCode(metadata);
_data = new Data(metadata, code, lastModified, _manager.getFileEncoding(), mdFile.exists());
try {
cache.writeEntry(cacheKey, _data);
}
catch (CacheException e) {
_manager.getLog().error("Exception writing design cache", e);
}