Fix for offline file support, AR-67.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2432 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-02-17 15:29:04 +00:00
parent 9d7374c868
commit d060a79d0b
2 changed files with 9 additions and 3 deletions

View File

@@ -5687,7 +5687,7 @@ public class NTProtocolHandler extends CoreProtocolHandler
// Build the NT create andX response // Build the NT create andX response
outPkt.setParameterCount((flags & WinNT.ExtendedResponse) != 0 ? 42 : 34); outPkt.setParameterCount( 34);
outPkt.setAndXCommand(0xFF); outPkt.setAndXCommand(0xFF);
outPkt.setParameter(1, 0); // AndX offset outPkt.setParameter(1, 0); // AndX offset
@@ -5696,7 +5696,7 @@ public class NTProtocolHandler extends CoreProtocolHandler
// Fake the oplock for certain file types // Fake the oplock for certain file types
boolean fakeOpLocks = false; boolean fakeOpLocks = FakeOpLocks;
String fname = params.getPath().toUpperCase(); String fname = params.getPath().toUpperCase();
if ( fname.endsWith( ".URL")){ if ( fname.endsWith( ".URL")){
@@ -5778,7 +5778,7 @@ public class NTProtocolHandler extends CoreProtocolHandler
prms.packLong(fileSize); // Allocation size prms.packLong(fileSize); // Allocation size
prms.packLong(netFile.getFileSize()); // End of file prms.packLong(netFile.getFileSize()); // End of file
prms.packWord(0); // File type - disk file prms.packWord(0); // File type - disk file
prms.packWord(0); // Device state prms.packWord((flags & WinNT.ExtendedResponse) != 0 ? 7 : 0); // Device state
prms.packByte(netFile.isDirectory() ? 1 : 0); prms.packByte(netFile.isDirectory() ? 1 : 0);
prms.packWord(0); // byte count = 0 prms.packWord(0); // byte count = 0

View File

@@ -239,6 +239,7 @@ public class CifsHelper
{ {
long modified = DefaultTypeConverter.INSTANCE.longValue(modifiedDate); long modified = DefaultTypeConverter.INSTANCE.longValue(modifiedDate);
fileInfo.setModifyDateTime(modified); fileInfo.setModifyDateTime(modified);
fileInfo.setAccessDateTime(modified);
} }
// name // name
String name = fileFolderInfo.getName(); String name = fileFolderInfo.getName();
@@ -252,6 +253,11 @@ public class CifsHelper
if ( permissionService.hasPermission(nodeRef, PermissionService.WRITE) == AccessStatus.DENIED) if ( permissionService.hasPermission(nodeRef, PermissionService.WRITE) == AccessStatus.DENIED)
fileInfo.setFileAttributes(fileInfo.getFileAttributes() + FileAttribute.ReadOnly); fileInfo.setFileAttributes(fileInfo.getFileAttributes() + FileAttribute.ReadOnly);
// Set the normal file attribute if no other attributes are set
if ( fileInfo.getFileAttributes() == 0)
fileInfo.setFileAttributes(FileAttribute.NTNormal);
// Debug // Debug
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())