Browse Source

getAbsoluteFile is useless since as the javadoc of File.toURI clearly explain, produced URIs are absolute

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

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

@@ -405,7 +405,7 @@ public final class Locator {
@Deprecated @Deprecated
public static URL fileToURL(File file) public static URL fileToURL(File file)
throws MalformedURLException { throws MalformedURLException {
return new URL(file.getAbsoluteFile().toURI().toASCIIString());
return new URL(file.toURI().toASCIIString());
} }


/** /**


+ 2
- 2
src/main/org/apache/tools/ant/util/FileUtils.java View File

@@ -138,7 +138,7 @@ public class FileUtils {
* formed. * formed.
*/ */
public URL getFileURL(File file) throws MalformedURLException { public URL getFileURL(File file) throws MalformedURLException {
return new URL(toURI(file.getAbsolutePath()));
return new URL(file.toURI().toASCIIString());
} }


/** /**
@@ -1209,7 +1209,7 @@ public class FileUtils {
* @since Ant 1.6 * @since Ant 1.6
*/ */
public String toURI(String path) { public String toURI(String path) {
return new File(path).getAbsoluteFile().toURI().toASCIIString();
return new File(path).toURI().toASCIIString();
} }


/** /**


Loading…
Cancel
Save