svn commit: r802666 - /camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r802666 - /camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java

davsclaus-2
Author: davsclaus
Date: Mon Aug 10 07:08:21 2009
New Revision: 802666

URL: http://svn.apache.org/viewvc?rev=802666&view=rev
Log:
CAMEL-1895: unit test how to poll enrich a 2nd file triggered by a file consumer

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java?rev=802666&r1=802665&r2=802666&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/FileUtil.java Mon Aug 10 07:08:21 2009
@@ -184,6 +184,17 @@
         return name;
     }
 
+    public static String stripExt(String name) {
+        if (name == null) {
+            return null;
+        }
+        int pos = name.lastIndexOf('.');
+        if (pos != -1) {
+            return name.substring(0, pos);
+        }
+        return name;
+    }
+
     /**
      * Returns only the leading path (returns <tt>null</tt> if no path)
      */