You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by ru...@apache.org on 2010/02/12 03:33:17 UTC
svn commit: r909209 -
/synapse/branches/1.3/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSUtils.java
Author: ruwan
Date: Fri Feb 12 02:33:16 2010
New Revision: 909209
URL: http://svn.apache.org/viewvc?rev=909209&view=rev
Log:
Fixing the issue SYNAPSE-607, applying the patch from Rajika
Modified:
synapse/branches/1.3/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSUtils.java
Modified: synapse/branches/1.3/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSUtils.java
URL: http://svn.apache.org/viewvc/synapse/branches/1.3/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSUtils.java?rev=909209&r1=909208&r2=909209&view=diff
==============================================================================
--- synapse/branches/1.3/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSUtils.java (original)
+++ synapse/branches/1.3/modules/transports/core/vfs/src/main/java/org/apache/synapse/transport/vfs/VFSUtils.java Fri Feb 12 02:33:16 2010
@@ -104,7 +104,12 @@
// check whether there is an existing lock for this item, if so it is assumed
// to be processed by an another listener (downloading) or a sender (uploading)
// lock file is derived by attaching the ".lock" second extension to the file name
- FileObject lockObject = fsManager.resolveFile(fo.getURL().toString() + ".lock");
+ String fullPath = fo.getURL().toString();
+ int pos = fullPath.indexOf("?");
+ if (pos != -1) {
+ fullPath = fullPath.substring(0, pos);
+ }
+ FileObject lockObject = fsManager.resolveFile(fullPath + ".lock");
if (lockObject.exists()) {
log.debug("There seems to be an external lock, aborting the processing of the file "
+ fo.getName() + ". This could possibly be due to some other party already "
@@ -122,7 +127,7 @@
} catch (IOException e) {
lockObject.delete();
log.debug("Couldn't create the lock file before processing the file "
- + fo.getName(), e);
+ + fullPath, e);
return false;
} finally {
lockObject.close();
@@ -134,7 +139,7 @@
// as the written random lock value.
// NOTE: this may not be optimal but is sub optimal
FileObject verifyingLockObject = fsManager.resolveFile(
- fo.getURL().toString() + ".lock");
+ fullPath + ".lock");
if (verifyingLockObject.exists() && verifyLock(lockValue, verifyingLockObject)) {
return true;
}