svn commit: r682657 - /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: r682657 - /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/FileUtil.java

jacopoc
Author: jacopoc
Date: Tue Aug  5 02:54:05 2008
New Revision: 682657

URL: http://svn.apache.org/viewvc?rev=682657&view=rev
Log:
Formatting and code cleanups after last commit.

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=682657&r1=682656&r2=682657&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 Tue Aug  5 02:54:05 2008
@@ -46,24 +46,13 @@
 
     public static final String module = FileUtil.class.getName();
 
-    public static String escapeSeparator( String separator )
-    {
-      if( "\\".equals( separator ) )
-      {
-        return "\\" + separator;
-      }
-      else
-      {
-        return separator;
-      }
-    }
-    
     public static File getFile(String path) {
-        return new File(path.replaceAll("/+|\\\\+", escapeSeparator(File.separator)));
+        return getFile(null, path);
     }
 
     public static File getFile(File root, String path) {
-        return new File(root, path.replaceAll("/+|\\\\+", escapeSeparator(File.separator)));
+        String fileNameSeparator = ("\\".equals(File.separator)? "\\" + File.separator: File.separator);
+        return new File(root, path.replaceAll("/+|\\\\+", fileNameSeparator));
     }
 
     public static void writeString(String fileName, String s) throws IOException {