mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added check for open for overwrite in the main openFile() method so that it covers
FTP as well as CIFS file opens. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2263 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -945,6 +945,16 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
|
|||||||
fstate.setNodeRef(nodeRef);
|
fstate.setNodeRef(nodeRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the file has been opened for overwrite then truncate the file to zero length, this will
|
||||||
|
// also prevent the existing content data from being copied to the new version of the file
|
||||||
|
|
||||||
|
if ( params.isOverwrite() && netFile != null)
|
||||||
|
{
|
||||||
|
// Truncate the file to zero length
|
||||||
|
|
||||||
|
netFile.truncateFile( 0L);
|
||||||
|
}
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
|
Reference in New Issue
Block a user