|
|
|
@@ -17,6 +17,8 @@ |
|
|
|
*/ |
|
|
|
package org.apache.tools.ant.launch; |
|
|
|
|
|
|
|
import org.apache.tools.ant.util.FileUtils; |
|
|
|
|
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.File; |
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
@@ -472,8 +474,9 @@ public final class Locator { |
|
|
|
*/ |
|
|
|
public static URL[] getLocationURLs(File location, |
|
|
|
final String... extensions) |
|
|
|
throws MalformedURLException { |
|
|
|
throws MalformedURLException { |
|
|
|
URL[] urls = new URL[0]; |
|
|
|
FileUtils utils = FileUtils.getFileUtils(); |
|
|
|
|
|
|
|
if (!location.exists()) { |
|
|
|
return urls; |
|
|
|
@@ -484,7 +487,7 @@ public final class Locator { |
|
|
|
String littlePath = path.toLowerCase(Locale.ENGLISH); |
|
|
|
for (String extension : extensions) { |
|
|
|
if (littlePath.endsWith(extension)) { |
|
|
|
urls[0] = fileToURL(location); |
|
|
|
urls[0] = utils.getFileURL(location); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -496,7 +499,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] = utils.getFileURL(matches[i]); |
|
|
|
} |
|
|
|
return urls; |
|
|
|
} |
|
|
|
|