ALF-11685 CIFS: Emacs editor leaves data (dates and filenames) in bad state

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32357 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2011-11-28 16:39:18 +00:00
parent c6f4ac8b57
commit 54e823abdd

View File

@@ -1885,10 +1885,10 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
// Check if the file is being marked for deletion, if so then check if the file is locked
if ( info.hasSetFlag(FileInfo.SetDeleteOnClose) && info.hasDeleteOnClose())
{
if(logger.isDebugEnabled())
if(logger.isDebugEnabled())
{
logger.debug("Set Delete On Close for :" + name);
}
}
// Check for delete permission
if ( permissionService.hasPermission(nodeRef, PermissionService.DELETE) == AccessStatus.DENIED)
{
@@ -1917,15 +1917,19 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
if ( isFolder == true && getCifsHelper().isFolderEmpty( nodeRef) == false)
{
throw new DirectoryNotEmptyException( name);
}
if ( logger.isDebugEnabled())
{
logger.debug("Set deleteOnClose=true file=" + name);
}
}
}
}
if(info.isHidden())
{
if ( logger.isDebugEnabled())
{
logger.debug("Set hidden attribute" + name);
}
// Not yet implemented
}
if( info.hasSetFlag(FileInfo.SetAllocationSize))
{
if ( logger.isDebugEnabled())
@@ -1943,17 +1947,17 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
// The NTProtocolHandler sets the deleteOnClose in both
// info and the NetworkFile - it's the one in NetworkFile that works.
if ( info.hasSetFlag(FileInfo.SetCreationDate))
if ( info.hasSetFlag(FileInfo.SetCreationDate) && info.hasCreationDateTime())
{
// Set the creation date on the file/folder node
Date createDate = new Date( info.getCreationDateTime());
Date createDate = new Date(info.getCreationDateTime());
auditableProps.put(ContentModel.PROP_CREATED, createDate);
if ( logger.isDebugEnabled())
{
logger.debug("Set creation date" + name + ", " + createDate);
}
}
if ( info.hasSetFlag(FileInfo.SetModifyDate))
if ( info.hasSetFlag(FileInfo.SetModifyDate) && info.hasModifyDateTime())
{
// Set the modification date on the file/folder node
Date modifyDate = new Date( info.getModifyDateTime());