mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -653,30 +653,41 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
|
||||
paths = FileName.splitPath(searchPath);
|
||||
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
|
||||
|
||||
searchFolderState = getStateForPath(tree, paths[0]);
|
||||
if ( searchFolderState == null)
|
||||
{
|
||||
// Create a file state for the folder
|
||||
|
||||
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
|
||||
|
||||
if ( hasPseudoFileInterface())
|
||||
getPseudoFileInterface().addPseudoFilesToFolder( sess, tree, paths[0]);
|
||||
|
||||
// Find the node ref for the folder being searched
|
||||
|
||||
NodeRef nodeRef = getNodeForPath(tree, paths[0]);
|
||||
// Set the search node and file spec
|
||||
|
||||
if ( nodeRef != null)
|
||||
{
|
||||
searchRootNodeRef = nodeRef;
|
||||
searchFileSpec = paths[1];
|
||||
|
||||
// Make sure the node ref is stored in the file state
|
||||
|
||||
searchFolderState.setNodeRef( nodeRef);
|
||||
|
||||
// DEBUG
|
||||
|
||||
if ( logger.isDebugEnabled())
|
||||
|
@@ -161,34 +161,39 @@ public class ContentPseudoFileImpl implements PseudoFileInterface
|
||||
|
||||
// Add the URL link pseudo file, if enabled
|
||||
|
||||
if ( isCIFS && ctx.hasURLFile() && fstate.getNodeRef() != null)
|
||||
if ( isCIFS && ctx.hasURLFile())
|
||||
{
|
||||
// Build the URL file data
|
||||
// Make sure the state has the associated node details
|
||||
|
||||
StringBuilder urlStr = new StringBuilder();
|
||||
if ( fstate.getNodeRef() != null)
|
||||
{
|
||||
// Build the URL file data
|
||||
|
||||
urlStr.append("[InternetShortcut]\r\n");
|
||||
urlStr.append("URL=");
|
||||
urlStr.append(ctx.getURLPrefix());
|
||||
urlStr.append("navigate/browse/workspace/SpacesStore/");
|
||||
urlStr.append( fstate.getNodeRef().getId());
|
||||
urlStr.append("\r\n");
|
||||
StringBuilder urlStr = new StringBuilder();
|
||||
|
||||
// Create the in memory pseudo file for the URL link
|
||||
urlStr.append("[InternetShortcut]\r\n");
|
||||
urlStr.append("URL=");
|
||||
urlStr.append(ctx.getURLPrefix());
|
||||
urlStr.append("navigate/browse/workspace/SpacesStore/");
|
||||
urlStr.append( fstate.getNodeRef().getId());
|
||||
urlStr.append("\r\n");
|
||||
|
||||
byte[] urlData = urlStr.toString().getBytes();
|
||||
// Create the in memory pseudo file for the URL link
|
||||
|
||||
MemoryPseudoFile urlFile = new MemoryPseudoFile( ctx.getURLFileName(), urlData);
|
||||
fstate.addPseudoFile( urlFile);
|
||||
byte[] urlData = urlStr.toString().getBytes();
|
||||
|
||||
// Update the count of files added
|
||||
MemoryPseudoFile urlFile = new MemoryPseudoFile( ctx.getURLFileName(), urlData);
|
||||
fstate.addPseudoFile( urlFile);
|
||||
|
||||
pseudoCnt++;
|
||||
// Update the count of files added
|
||||
|
||||
// DEBUG
|
||||
pseudoCnt++;
|
||||
|
||||
if ( logger.isInfoEnabled())
|
||||
logger.info("Added URL link pseudo file for " + path);
|
||||
// DEBUG
|
||||
|
||||
if ( logger.isInfoEnabled())
|
||||
logger.info("Added URL link pseudo file for " + path);
|
||||
}
|
||||
}
|
||||
|
||||
// Return the count of pseudo files added
|
||||
|
Reference in New Issue
Block a user