From b031b8766db70f993b90b1852b6957bc02175f8d Mon Sep 17 00:00:00 2001 From: Nicolas Lalevee Date: Wed, 22 Aug 2012 18:10:37 +0000 Subject: [PATCH] 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 --- src/main/org/apache/tools/ant/launch/Locator.java | 2 +- src/main/org/apache/tools/ant/util/FileUtils.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/org/apache/tools/ant/launch/Locator.java b/src/main/org/apache/tools/ant/launch/Locator.java index 59f67872e..ea30b1be6 100644 --- a/src/main/org/apache/tools/ant/launch/Locator.java +++ b/src/main/org/apache/tools/ant/launch/Locator.java @@ -405,7 +405,7 @@ public final class Locator { @Deprecated public static URL fileToURL(File file) throws MalformedURLException { - return new URL(file.getAbsoluteFile().toURI().toASCIIString()); + return new URL(file.toURI().toASCIIString()); } /** diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java index b3e23368a..caaa82b61 100644 --- a/src/main/org/apache/tools/ant/util/FileUtils.java +++ b/src/main/org/apache/tools/ant/util/FileUtils.java @@ -138,7 +138,7 @@ public class FileUtils { * formed. */ 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 */ public String toURI(String path) { - return new File(path).getAbsoluteFile().toURI().toASCIIString(); + return new File(path).toURI().toASCIIString(); } /**