Browse Source

Make Locator.fileToURL and replace its use by FileUtils.getFileUtils().getFileURL()

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

+ 4
- 2
src/main/org/apache/tools/ant/launch/Launcher.java View File

@@ -25,6 +25,8 @@ import java.util.StringTokenizer;
import java.util.List;
import java.util.ArrayList;

import org.apache.tools.ant.util.FileUtils;



/**
@@ -150,7 +152,7 @@ public class Launcher {
}
}

URL url = Locator.fileToURL(element);
URL url = FileUtils.getFileUtils().getFileURL(element);
if (launchDiag) { System.out.println("adding library URL: " + url) ;}
libPathURLs.add(url);
}
@@ -381,7 +383,7 @@ public class Launcher {
systemJars.length);

if (toolsJar != null) {
jars[jars.length - 1] = Locator.fileToURL(toolsJar);
jars[jars.length - 1] = FileUtils.getFileUtils().getFileURL(toolsJar);
}
return jars;
}


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

@@ -400,7 +400,9 @@ public final class Locator {
* @param file the file to convert
* @return URL the converted File
* @throws MalformedURLException on error
* @deprecated since 1.9, use {@link FileUtils#getFileURL(File)}
*/
@Deprecated
public static URL fileToURL(File file)
throws MalformedURLException {
return FileUtils.getFileUtils().getFileURL(file);
@@ -501,7 +503,7 @@ public final class Locator {
String littlePath = path.toLowerCase(Locale.ENGLISH);
for (int i = 0; i < extensions.length; ++i) {
if (littlePath.endsWith(extensions[i])) {
urls[0] = fileToURL(location);
urls[0] = FileUtils.getFileUtils().getFileURL(location);
break;
}
}
@@ -521,7 +523,7 @@ public final class Locator {
});
urls = new URL[matches.length];
for (int i = 0; i < matches.length; ++i) {
urls[i] = fileToURL(matches[i]);
urls[i] = FileUtils.getFileUtils().getFileURL(matches[i]);
}
return urls;
}


Loading…
Cancel
Save