Fixed problem where URL pseudo files would occasionally not be added to the folder listing.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2341 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-02-10 15:46:08 +00:00
parent be2837cc0f
commit 902293d12a
2 changed files with 49 additions and 33 deletions

View File

@@ -653,30 +653,41 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
paths = FileName.splitPath(searchPath); paths = FileName.splitPath(searchPath);
if ( paths[0] != null && paths[0].length() > 1) if ( paths[0] != null && paths[0].length() > 1)
{ {
// Find the node ref for the folder being searched
NodeRef nodeRef = getNodeForPath(tree, paths[0]);
// Get the file state for the folder being searched // Get the file state for the folder being searched
searchFolderState = getStateForPath(tree, paths[0]); searchFolderState = getStateForPath(tree, paths[0]);
if ( searchFolderState == null) if ( searchFolderState == null)
{
// Create a file state for the folder
searchFolderState = ctx.getStateTable().findFileState( paths[0], true, true); searchFolderState = ctx.getStateTable().findFileState( paths[0], true, true);
}
// Make sure the associated node is set
if ( searchFolderState.hasNodeRef() == false)
{
// Set the associated node for the folder
searchFolderState.setNodeRef( nodeRef);
}
// Add pseudo files to the folder being searched // Add pseudo files to the folder being searched
if ( hasPseudoFileInterface()) if ( hasPseudoFileInterface())
getPseudoFileInterface().addPseudoFilesToFolder( sess, tree, paths[0]); getPseudoFileInterface().addPseudoFilesToFolder( sess, tree, paths[0]);
// Find the node ref for the folder being searched // Set the search node and file spec
NodeRef nodeRef = getNodeForPath(tree, paths[0]);
if ( nodeRef != null) if ( nodeRef != null)
{ {
searchRootNodeRef = nodeRef; searchRootNodeRef = nodeRef;
searchFileSpec = paths[1]; searchFileSpec = paths[1];
// Make sure the node ref is stored in the file state
searchFolderState.setNodeRef( nodeRef);
// DEBUG // DEBUG
if ( logger.isDebugEnabled()) if ( logger.isDebugEnabled())

View File

@@ -161,7 +161,11 @@ public class ContentPseudoFileImpl implements PseudoFileInterface
// Add the URL link pseudo file, if enabled // Add the URL link pseudo file, if enabled
if ( isCIFS && ctx.hasURLFile() && fstate.getNodeRef() != null) if ( isCIFS && ctx.hasURLFile())
{
// Make sure the state has the associated node details
if ( fstate.getNodeRef() != null)
{ {
// Build the URL file data // Build the URL file data
@@ -190,6 +194,7 @@ public class ContentPseudoFileImpl implements PseudoFileInterface
if ( logger.isInfoEnabled()) if ( logger.isInfoEnabled())
logger.info("Added URL link pseudo file for " + path); logger.info("Added URL link pseudo file for " + path);
} }
}
// Return the count of pseudo files added // Return the count of pseudo files added