mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Update the file size in the file state cache.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29745 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -226,12 +226,13 @@ public class BufferedContentDiskDriver implements ExtendedDiskInterface,
|
||||
if(tctx.hasStateCache())
|
||||
{
|
||||
FileStateCache cache = tctx.getStateCache();
|
||||
FileState fstate = tctx.getStateCache().findFileState(path, false);
|
||||
FileState fstate = cache.findFileState(path, false);
|
||||
if(fstate != null)
|
||||
{
|
||||
FileInfo finfo = new FileInfo();
|
||||
finfo.copyFrom(info);
|
||||
|
||||
|
||||
// TODO what if file state cache is stale or wrong? We are over-writing the "real" value.
|
||||
if(fstate.hasFileSize())
|
||||
{
|
||||
finfo.setFileSize(fstate.getFileSize());
|
||||
@@ -253,9 +254,23 @@ public class BufferedContentDiskDriver implements ExtendedDiskInterface,
|
||||
finfo.setAllocationSize( fstate.getAllocationSize());
|
||||
}
|
||||
|
||||
if(logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("getFileInformation path" + path + ", returning:" + finfo +
|
||||
", readOnly:"+info.isReadOnly() +
|
||||
", fileId:"+info.getFileId() +
|
||||
", directoryId:" + info.getDirectoryId() +
|
||||
", mode" + info.getMode());
|
||||
}
|
||||
|
||||
return finfo;
|
||||
}
|
||||
}
|
||||
|
||||
if(logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("getFileInformation returning:" + path + " returning" + info);
|
||||
}
|
||||
|
||||
return info;
|
||||
|
||||
|
Reference in New Issue
Block a user