svn commit: r682261 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/FileUtil.java

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

svn commit: r682261 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/FileUtil.java

doogie-3
Author: doogie
Date: Sun Aug  3 22:47:26 2008
New Revision: 682261

URL: http://svn.apache.org/viewvc?rev=682261&view=rev
Log:
Utility methods that convert string file paths to File objects.

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/FileUtil.java

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/FileUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/FileUtil.java?rev=682261&r1=682260&r2=682261&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/FileUtil.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/FileUtil.java Sun Aug  3 22:47:26 2008
@@ -46,6 +46,14 @@
 
     public static final String module = FileUtil.class.getName();
 
+    public static File getFile(String path) {
+        return new File(path.replaceAll("/+|\\\\+", File.separator));
+    }
+
+    public static File getFile(File root, String path) {
+        return new File(root, path.replaceAll("/+|\\\\+", File.separator));
+    }
+
     public static void writeString(String fileName, String s) throws IOException {
         writeString(null, fileName, s);
     }