mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fixed problem where a newly created file could get read-only access rights fi the open file request specified read access attributes.
This caused a problem with Excel saving files. AWC-1200. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6224 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -99,7 +99,7 @@ public class ContentDiskDriver extends AlfrescoDiskDriver implements DiskInterfa
|
|||||||
private static final String KEY_STORE = "store";
|
private static final String KEY_STORE = "store";
|
||||||
private static final String KEY_ROOT_PATH = "rootPath";
|
private static final String KEY_ROOT_PATH = "rootPath";
|
||||||
private static final String KEY_RELATIVE_PATH = "relativePath";
|
private static final String KEY_RELATIVE_PATH = "relativePath";
|
||||||
|
|
||||||
// Token name to substitute current servers DNS name or TCP/IP address into the webapp URL
|
// Token name to substitute current servers DNS name or TCP/IP address into the webapp URL
|
||||||
|
|
||||||
private static final String TokenLocalName = "${localname}";
|
private static final String TokenLocalName = "${localname}";
|
||||||
@@ -273,7 +273,7 @@ public class ContentDiskDriver extends AlfrescoDiskDriver implements DiskInterfa
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the file folder server
|
* Set the file folder service
|
||||||
*
|
*
|
||||||
* @param fileService FileFolderService
|
* @param fileService FileFolderService
|
||||||
*/
|
*/
|
||||||
@@ -361,13 +361,15 @@ public class ContentDiskDriver extends AlfrescoDiskDriver implements DiskInterfa
|
|||||||
}
|
}
|
||||||
else if (nodeRefs.size() == 0)
|
else if (nodeRefs.size() == 0)
|
||||||
{
|
{
|
||||||
// nothing found
|
// Nothing found
|
||||||
|
|
||||||
throw new DeviceContextException("No root found for device: \n" +
|
throw new DeviceContextException("No root found for device: \n" +
|
||||||
" root path: " + rootPath);
|
" root path: " + rootPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// we found a node
|
// We found a node
|
||||||
|
|
||||||
rootNodeRef = nodeRefs.get(0);
|
rootNodeRef = nodeRefs.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1416,12 +1418,16 @@ public class ContentDiskDriver extends AlfrescoDiskDriver implements DiskInterfa
|
|||||||
|
|
||||||
// Create the network file
|
// Create the network file
|
||||||
|
|
||||||
NetworkFile netFile = ContentNetworkFile.createFile(nodeService, contentService, mimetypeService, cifsHelper, nodeRef, params);
|
ContentNetworkFile netFile = ContentNetworkFile.createFile(nodeService, contentService, mimetypeService, cifsHelper, nodeRef, params);
|
||||||
|
|
||||||
|
// Always allow write access to a newly created file
|
||||||
|
|
||||||
|
netFile.setGrantedAccess(NetworkFile.READWRITE);
|
||||||
|
|
||||||
// Truncate the file so that the content stream is created
|
// Truncate the file so that the content stream is created
|
||||||
|
|
||||||
netFile.truncateFile( 0L);
|
netFile.truncateFile( 0L);
|
||||||
|
|
||||||
// Generate a file id for the file
|
// Generate a file id for the file
|
||||||
|
|
||||||
if ( netFile != null)
|
if ( netFile != null)
|
||||||
|
Reference in New Issue
Block a user