Browse Source

To make an URL of a file, use FileUtils.getFileURL, which seems to do the job correctly

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1376014 13f79535-47bb-0310-9956-ffa450edef68
master
Nicolas Lalevee 13 years ago
parent
commit
7829faf36a
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      src/main/org/apache/tools/ant/launch/Locator.java

+ 3
- 5
src/main/org/apache/tools/ant/launch/Locator.java View File

@@ -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);
}

/**


Loading…
Cancel
Save