camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r580349 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/DefaultFileRenamer.java
Date Fri, 28 Sep 2007 13:37:56 GMT
Author: chirino
Date: Fri Sep 28 06:37:56 2007
New Revision: 580349

URL: http://svn.apache.org/viewvc?rev=580349&view=rev
Log:
Support renaming across different windows drives.  See:
http://www.nabble.com/File-component%2C-feature-request-tf4529262s2354.html#a12924158
for more info about the request.


Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/DefaultFileRenamer.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/DefaultFileRenamer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/DefaultFileRenamer.java?rev=580349&r1=580348&r2=580349&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/DefaultFileRenamer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/DefaultFileRenamer.java
Fri Sep 28 06:37:56 2007
@@ -23,6 +23,9 @@
  * @version $Revision: 1.1 $
  */
 public class DefaultFileRenamer implements FileRenamer {
+	
+	private static final boolean ON_WINDOWS = System.getProperty("os.name").startsWith("Windows");
+	
     private String namePrefix;
     private String namePostfix;
 
@@ -37,6 +40,10 @@
     public File renameFile(File file) {
         File parent = file.getParentFile();
         String name = renameFileName(file);
+        
+        if( ON_WINDOWS && ( name.indexOf(":")>=0 || name.startsWith("//") )) {
+            return new File(name);
+        }        
         return new File(parent, name);
     }
 



Mime
View raw message