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:
Gary Spencer
2006-01-31 15:47:59 +00:00
parent dc140df4ed
commit 2f7aaab592

View File

@@ -945,6 +945,16 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
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
if (logger.isDebugEnabled())