Merge V1.3 to HEAD (3045:3063)

svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3045 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3063 .


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3340 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-07-18 15:22:09 +00:00
parent a05f525a7d
commit dbffd532f7
9 changed files with 41 additions and 84 deletions

View File

@@ -6576,42 +6576,13 @@ public class NTProtocolHandler extends CoreProtocolHandler
return; return;
} }
// Check if this is a buffer length check, if so the maximum returned data count will be // Return an empty security descriptor
// zero
if (tbuf.getReturnDataLimit() == 0)
{
// Return the security descriptor length in the parameter block
byte[] paramblk = new byte[4]; byte[] paramblk = new byte[4];
DataPacker.putIntelInt(_sdEveryOne.length, paramblk, 0); DataPacker.putIntelInt(0, paramblk, 0);
// Initialize the transaction reply
outPkt.initTransactReply(paramblk, paramblk.length, null, 0); outPkt.initTransactReply(paramblk, paramblk.length, null, 0);
// Set a warning status to indicate the supplied data buffer was too small to return the
// security
// descriptor
outPkt.setLongErrorCode(SMBStatus.NTBufferTooSmall);
}
else
{
// Return the security descriptor length in the parameter block
byte[] paramblk = new byte[4];
DataPacker.putIntelInt(_sdEveryOne.length, paramblk, 0);
// Initialize the transaction reply. Return the fixed security descriptor that allows
// anyone to access the
// file/directory
outPkt.initTransactReply(paramblk, paramblk.length, _sdEveryOne, _sdEveryOne.length);
}
// Send back the response // Send back the response
m_sess.sendResponseSMB(outPkt); m_sess.sendResponseSMB(outPkt);

View File

@@ -1344,7 +1344,7 @@ public class SMBSrvSession extends SrvSession implements Runnable
// We are using case sensitive pathnames and long file names // We are using case sensitive pathnames and long file names
setDefaultFlags(0); setDefaultFlags(SMBSrvPacket.FLG_CASELESS);
setDefaultFlags2(SMBSrvPacket.FLG2_LONGFILENAMES + SMBSrvPacket.FLG2_UNICODE); setDefaultFlags2(SMBSrvPacket.FLG2_LONGFILENAMES + SMBSrvPacket.FLG2_UNICODE);
// Access the authenticator for this server and determine if the server is in share or // Access the authenticator for this server and determine if the server is in share or

View File

@@ -598,10 +598,8 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
{ {
// a valid use case // a valid use case
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{
logger.debug("Getting file information - File not found: \n" + logger.debug("Getting file information - File not found: \n" +
" path: " + path); " path: " + path);
}
throw e; throw e;
} }
catch (org.alfresco.repo.security.permissions.AccessDeniedException ex) catch (org.alfresco.repo.security.permissions.AccessDeniedException ex)
@@ -1449,7 +1447,8 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
try try
{ {
// get the node // Get the node
NodeRef nodeRef = getNodeForPath(tree, name); NodeRef nodeRef = getNodeForPath(tree, name);
if (nodeService.exists(nodeRef)) if (nodeService.exists(nodeRef))
{ {
@@ -1603,7 +1602,10 @@ public class ContentDiskDriver implements DiskInterface, IOCtlInterface
// DEBUG // DEBUG
if ( logger.isDebugEnabled()) if ( logger.isDebugEnabled())
{
logger.debug("Cached rename state for " + oldName + ", state=" + fstate); logger.debug("Cached rename state for " + oldName + ", state=" + fstate);
logger.debug(" new name " + newName + ", state=" + newState);
}
} }
} }
else else

View File

@@ -20,7 +20,6 @@ import org.alfresco.filesys.locking.FileLock;
import org.alfresco.filesys.locking.FileLockList; import org.alfresco.filesys.locking.FileLockList;
import org.alfresco.filesys.locking.LockConflictException; import org.alfresco.filesys.locking.LockConflictException;
import org.alfresco.filesys.locking.NotLockedException; import org.alfresco.filesys.locking.NotLockedException;
import org.alfresco.filesys.server.filesys.FileName;
import org.alfresco.filesys.server.filesys.FileOpenParams; import org.alfresco.filesys.server.filesys.FileOpenParams;
import org.alfresco.filesys.server.filesys.FileStatus; import org.alfresco.filesys.server.filesys.FileStatus;
import org.alfresco.filesys.smb.SharingMode; import org.alfresco.filesys.smb.SharingMode;
@@ -587,35 +586,7 @@ public class FileState
*/ */
public final static String normalizePath(String path) public final static String normalizePath(String path)
{ {
return path.toUpperCase();
// Split the path into directories and file name, only uppercase the directories to
// normalize the path.
String normPath = path;
if (path.length() > 3)
{
// Split the path to seperate the folders/file name
int pos = path.lastIndexOf(FileName.DOS_SEPERATOR);
if (pos != -1)
{
// Get the path and file name parts, normalize the path
String pathPart = path.substring(0, pos).toUpperCase();
String namePart = path.substring(pos);
// Rebuild the path string
normPath = pathPart + namePart;
}
}
// Return the normalized path
return normPath;
} }
/** /**

View File

@@ -448,7 +448,7 @@ public class FileStateTable implements Runnable
// Dump the file state cache entries to the specified stream // Dump the file state cache entries to the specified stream
if (m_stateTable.size() > 0) if (m_stateTable.size() > 0)
logger.info("++ FileStateCache Entries:"); logger.debug("++ FileStateCache Entries:");
Enumeration enm = m_stateTable.keys(); Enumeration enm = m_stateTable.keys();
long curTime = System.currentTimeMillis(); long curTime = System.currentTimeMillis();
@@ -458,7 +458,7 @@ public class FileStateTable implements Runnable
String fname = (String) enm.nextElement(); String fname = (String) enm.nextElement();
FileState state = m_stateTable.get(fname); FileState state = m_stateTable.get(fname);
logger.info(" ++ " + fname + "(" + state.getSecondsToExpire(curTime) + ") : " + state); logger.debug(" ++ " + fname + "(" + state.getSecondsToExpire(curTime) + ") : " + state);
} }
} }
} }

View File

@@ -467,21 +467,34 @@ public class FileFolderServiceImpl implements FileFolderService
targetParentRef = assocRef.getParentRef(); targetParentRef = assocRef.getParentRef();
} }
boolean checkExists = true;
if (targetParentRef.equals(assocRef.getParentRef()))
{
// there is nothing to do if both the name and parent folder haven't changed // there is nothing to do if both the name and parent folder haven't changed
if (targetParentRef.equals(assocRef.getParentRef()) && newName.equals(beforeFileInfo.getName())) if (newName.equals(beforeFileInfo.getName()))
{ {
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
{ {
logger.debug("Doing nothing - neither filename or parent has not changed: \n" + logger.debug("Doing nothing - neither filename or parent has changed: \n" +
" parent: " + targetParentRef + "\n" + " parent: " + targetParentRef + "\n" +
" before: " + beforeFileInfo + "\n" + " before: " + beforeFileInfo + "\n" +
" new name: " + newName); " new name: " + newName);
} }
return beforeFileInfo; return beforeFileInfo;
} }
else if (newName.equalsIgnoreCase(beforeFileInfo.getName()))
{
// name has only changed case so don't bother with exists check
checkExists = false;
}
}
// check for existing file or folder // check for existing file or folder (if name has changed)
if (checkExists)
{
checkExists(targetParentRef, newName); checkExists(targetParentRef, newName);
}
QName qname = QName.createQName( QName qname = QName.createQName(
NamespaceService.CONTENT_MODEL_1_0_URI, NamespaceService.CONTENT_MODEL_1_0_URI,

View File

@@ -409,7 +409,7 @@ public class Import extends Tool
throw new ToolArgumentException("Source directory " + fileSourceDir.getAbsolutePath() + " does not exist."); throw new ToolArgumentException("Source directory " + fileSourceDir.getAbsolutePath() + " does not exist.");
} }
} }
if (packageName.endsWith(".acp")) if (packageName.endsWith(".acp") || packageName.endsWith(".zip"))
{ {
File packageFile = new File(getSourceDir(), packageName); File packageFile = new File(getSourceDir(), packageName);
if (!packageFile.exists()) if (!packageFile.exists())

View File

@@ -34,7 +34,7 @@ public class SearchLanguageConversion
* <li>Reserved: \%_</li> * <li>Reserved: \%_</li>
* </ul> * </ul>
*/ */
public static LanguageDefinition DEF_XPATH_LIKE = new SimpleLanguageDef('\\', "%", "_", "\\%_"); public static LanguageDefinition DEF_XPATH_LIKE = new SimpleLanguageDef('\\', "%", "_", "\\%_[]");
/** /**
* Regular expression query language summary: * Regular expression query language summary:
* <ul> * <ul>

View File

@@ -42,7 +42,7 @@ public class SearchLanguageConversionTest extends TestCase
assertEquals("Escaping for xpath failed", assertEquals("Escaping for xpath failed",
"\\\\ | ! \" £ " + "\\\\ | ! \" £ " +
"$ \\% ^ & * ( " + "$ \\% ^ & * ( " +
") \\_ { } [ ] " + ") \\_ { } \\[ \\] " +
"@ # ~ ' : ; " + "@ # ~ ' : ; " +
", . < > + ? " + ", . < > + ? " +
"/ \\\\\\\\ \\\\* \\\\? \\\\\\_", "/ \\\\\\\\ \\\\* \\\\? \\\\\\_",