mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merge 3.2 to HEAD:
15128: Merge 3.1 to 3.2: 15114: Added support for impersonation level sharing mode check, to fix Office2007 file open issue. ETHREEOH-2320. 15130: Record-only 15340: Merge 3.1 to 3.2: 14359: Fixed native call being used when <disableNative/> was configured. ETHREEOH-2105. (Record-only) 14484: Merged HEAD to v3.1: (Record-only) 13943 Added FTP IPv6 configuration, via the <IPv6 state="enabled|disabled"/> tag. Added the ftp.ipv6 property. MOB-714. 14523: Add trailing 'A' to CIFS server name, removed by recent checkin. (Record-only) 14561: Change the file server config bean to use the 'org.alfresco.fileserver' logging level. 14916: Fixes for local domain lookup when WINS is configured. ETHREEOH-2263. 14922: Merge HEAD to V3.1 14626: Fixes for the client side Windows desktop action application. part of ETHREEOH-401 15155: Fixes to client side desktop action exe handling of paths that are not mapped to the root of the Alfresco share. ETHREEOH-1613 15341: Record-only 15549: Check for null ClientInfo in the setCurrentUser() method and clear the auth context. Part of ETHREEOH-2538. 15550: Fixed performance issue in the continue search code, add warn level output of folder search timing. 15564: Merge 3.1 to 3.2: 14964: Port fix for convert content I/O exceptions to file server exceptions during write and truncate (part 2). ETWOTWO-1241 15233: Ignore nodes that no longer exist during the second stage of a file server folder search. 15234: Fixed incorrect length check when buffering MSOffice document writes. 15565: Record-only 15568: Fix for cut/paste file between folders on CIFS. ETHREEOH-2323 + ENH-515. 15569: Record-only 15644: Changed filesystem debug setting so it works with old and new config styles. 15786: Record-only 15787: Port of repo filesystem MS Office document locking fix. ETHREEOH-2579 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16122 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -47,6 +47,7 @@ import org.alfresco.repo.content.encoding.ContentCharsetFinder;
|
||||
import org.alfresco.repo.content.filestore.FileContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentAccessor;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.cmr.repository.ContentIOException;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
@@ -426,25 +427,38 @@ public class ContentNetworkFile extends NodeRefNetworkFile
|
||||
public void truncateFile(long size)
|
||||
throws IOException
|
||||
{
|
||||
// If the content data channel has not been opened yet and the requested size is zero
|
||||
// then this is an open for overwrite so the existing content data is not copied
|
||||
|
||||
if ( hasContent() == false && size == 0L)
|
||||
{
|
||||
// Open content for overwrite, no need to copy existing content data
|
||||
try {
|
||||
// If the content data channel has not been opened yet and the requested size is zero
|
||||
// then this is an open for overwrite so the existing content data is not copied
|
||||
|
||||
openContent(true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Normal open for write
|
||||
|
||||
openContent(true, false);
|
||||
if ( hasContent() == false && size == 0L)
|
||||
{
|
||||
// Open content for overwrite, no need to copy existing content data
|
||||
|
||||
openContent(true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Normal open for write
|
||||
|
||||
openContent(true, false);
|
||||
|
||||
// Truncate or extend the channel
|
||||
|
||||
channel.truncate(size);
|
||||
}
|
||||
// Truncate or extend the channel
|
||||
|
||||
channel.truncate(size);
|
||||
}
|
||||
}
|
||||
catch ( ContentIOException ex) {
|
||||
|
||||
// DEBUG
|
||||
|
||||
if ( logger.isDebugEnabled())
|
||||
logger.debug("Error opening file " + getFullName() + " for write", ex);
|
||||
|
||||
// Convert to a file server I/O error
|
||||
|
||||
throw new DiskFullException("Failed to open " + getFullName() + " for write");
|
||||
}
|
||||
|
||||
// Set modification flag
|
||||
|
||||
@@ -477,9 +491,22 @@ public class ContentNetworkFile extends NodeRefNetworkFile
|
||||
public void writeFile(byte[] buffer, int length, int position, long fileOffset)
|
||||
throws IOException
|
||||
{
|
||||
// Open the channel for writing
|
||||
|
||||
openContent(true, false);
|
||||
try {
|
||||
// Open the channel for writing
|
||||
|
||||
openContent(true, false);
|
||||
}
|
||||
catch ( ContentIOException ex) {
|
||||
|
||||
// DEBUG
|
||||
|
||||
if ( logger.isDebugEnabled())
|
||||
logger.debug("Error opening file " + getFullName() + " for write", ex);
|
||||
|
||||
// Convert to a file server I/O error
|
||||
|
||||
throw new DiskFullException("Failed to open " + getFullName() + " for write");
|
||||
}
|
||||
|
||||
// Write to the channel
|
||||
|
||||
|
Reference in New Issue
Block a user