ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1376014 - /ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
Date Wed, 22 Aug 2012 12:31:57 GMT
Author: hibou
Date: Wed Aug 22 12:31:57 2012
New Revision: 1376014

URL: http://svn.apache.org/viewvc?rev=1376014&view=rev
Log:
To make an URL of a file, use FileUtils.getFileURL, which seems to do the job correctly

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?rev=1376014&r1=1376013&r2=1376014&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java Wed Aug 22 12:31:57 2012
@@ -27,6 +27,8 @@ import java.text.CharacterIterator;
 import java.text.StringCharacterIterator;
 import java.util.Locale;
 
+import org.apache.tools.ant.util.FileUtils;
+
 // CheckStyle:LineLengthCheck OFF - urls are long!
 /**
  * The Locator is a utility class which is used to find certain items
@@ -401,11 +403,7 @@ public final class Locator {
      */
     public static URL fileToURL(File file)
         throws MalformedURLException {
-        try {
-            return new URL(encodeURI(file.toURL().toString()));
-        } catch (UnsupportedEncodingException ex) {
-            throw new MalformedURLException(ex.toString());
-        }
+        return FileUtils.getFileUtils().getFileURL(file);
     }
 
     /**



Mime
View raw message