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:
Gary Spencer
2009-09-07 13:04:53 +00:00
parent a4445319d8
commit a6eb590cc9
13 changed files with 585 additions and 262 deletions

View File

@@ -34,6 +34,7 @@ import org.alfresco.jlan.server.filesys.FileType;
import org.alfresco.jlan.server.filesys.SearchContext;
import org.alfresco.jlan.server.filesys.pseudo.PseudoFile;
import org.alfresco.jlan.server.filesys.pseudo.PseudoFileList;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -76,6 +77,10 @@ public class ContentSearchContext extends SearchContext
private String m_relPath;
// Keep track of the last file name returned for fast restartAt processing
private String m_lastFileName;
/**
* Class constructor
*
@@ -111,10 +116,18 @@ public class ContentSearchContext extends SearchContext
public String toString()
{
StringBuilder sb = new StringBuilder(60);
sb.append("ContentSearchContext")
.append("[ searchStr=").append(getSearchString())
.append(", resultCount=").append(results.size())
.append("]");
sb.append("[ContentSearchContext searchStr=");
sb.append(getSearchString());
sb.append(", resultCount=");
sb.append(results.size());
sb.append(", pseudoList=");
if ( pseudoList != null)
sb.append( pseudoList.numberOfFiles());
else
sb.append("NULL");
sb.append("]");
return sb.toString();
}
@@ -205,17 +218,46 @@ public class ContentSearchContext extends SearchContext
}
}
// Get the next file info from the node search
NodeRef nextNodeRef = results.get(index);
// Return the next available file information for a real file/folder
try
{
// Get the file information and copy across to the callers file info
ContentFileInfo nextInfo = cifsHelper.getFileInformation(nextNodeRef, "");
info.copyFrom(nextInfo);
// Loop until we get a valid node, might have been deleted since the initial folder search
ContentFileInfo nextInfo = null;
while ( nextInfo == null && index < results.size())
{
// Get the next node from the search
NodeRef nextNodeRef = results.get(index);
try {
// Get the file information and copy across to the callers file info
nextInfo = cifsHelper.getFileInformation(nextNodeRef, "");
info.copyFrom(nextInfo);
}
catch ( InvalidNodeRefException ex) {
// Log a warning
if ( logger.isWarnEnabled())
logger.warn("Noderef " + nextNodeRef + " no longer valid, ignoring");
// Update the node index, node no longer exists, try the next node in the search
index++;
resumeId++;
}
}
// Check if we have finished returning file info
if ( nextInfo == null)
return false;
// Generate a file id for the current file
StringBuilder pathStr = new StringBuilder( m_relPath);
@@ -243,6 +285,10 @@ public class ContentSearchContext extends SearchContext
else
info.setFileType( FileType.RegularFile);
// Keep track of the last file name returned
m_lastFileName = info.getFileName();
// Indicate that the file information is valid
return true;
@@ -313,6 +359,10 @@ public class ContentSearchContext extends SearchContext
// Get the file information and copy across to the callers file info
FileInfo nextInfo = cifsHelper.getFileInformation(nextNodeRef, "");
// Keep track of the last file name returned
m_lastFileName = nextInfo.getFileName();
// Indicate that the file information is valid
@@ -360,6 +410,17 @@ public class ContentSearchContext extends SearchContext
}
}
// Check if the resume file name is the last file returned, no need to reposition the file index
if ( m_lastFileName != null && info.getFileName().equalsIgnoreCase( m_lastFileName)) {
// DEBUG
if ( logger.isDebugEnabled())
logger.debug("Fast search restart - " + m_lastFileName);
return true;
}
// Check if the resume file is in the main file list
if ( results != null)