mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
ALF-9613: fix some cases of content being in in-memory cache but not on disk.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29957 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -63,7 +63,11 @@ public class ContentCacheImpl implements ContentCache
|
||||
if (memoryStore.contains(contentUrl))
|
||||
{
|
||||
String path = memoryStore.get(contentUrl);
|
||||
return new FileContentReader(new File(path), contentUrl);
|
||||
File cacheFile = new File(path);
|
||||
if (cacheFile.exists())
|
||||
{
|
||||
return new FileContentReader(cacheFile, contentUrl);
|
||||
}
|
||||
}
|
||||
|
||||
throw new CacheMissException(contentUrl);
|
||||
@@ -173,4 +177,13 @@ public class ContentCacheImpl implements ContentCache
|
||||
{
|
||||
this.memoryStore = memoryStore;
|
||||
}
|
||||
|
||||
|
||||
// Not part of the ContentCache interface as this breaks encapsulation.
|
||||
// Handy method for tests though, since it allows us to find out where
|
||||
// the content was cached.
|
||||
protected String cacheFileLocation(String url)
|
||||
{
|
||||
return memoryStore.get(url);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user