aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/tools/anttasks
diff options
context:
space:
mode:
authorAndreas L. Delmelle <adelmelle@apache.org>2008-07-13 10:26:48 +0000
committerAndreas L. Delmelle <adelmelle@apache.org>2008-07-13 10:26:48 +0000
commit65ff8feed50291ddc834006d279fc26a640d0fb5 (patch)
tree9ace2a7d9d9f8e962395bd689af3a3572649f7af /src/java/org/apache/fop/tools/anttasks
parentd98eb3e8a5612dd77b12613e5245da9d3461a750 (diff)
downloadxmlgraphics-fop-65ff8feed50291ddc834006d279fc26a640d0fb5.tar.gz
xmlgraphics-fop-65ff8feed50291ddc834006d279fc26a640d0fb5.zip
Replace occurrences of File.toURL() by File.toURI().toURL() (recommended as of Java 6, where File.toURL() is deprecated)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@676297 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/tools/anttasks')
-rw-r--r--src/java/org/apache/fop/tools/anttasks/Fop.java8
-rw-r--r--src/java/org/apache/fop/tools/anttasks/RunTest.java4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/tools/anttasks/Fop.java b/src/java/org/apache/fop/tools/anttasks/Fop.java
index 83217651e..da25478c3 100644
--- a/src/java/org/apache/fop/tools/anttasks/Fop.java
+++ b/src/java/org/apache/fop/tools/anttasks/Fop.java
@@ -444,14 +444,14 @@ class FOPTaskStarter {
//Set base directory
if (task.getBasedir() != null) {
try {
- this.baseURL = task.getBasedir().toURL().toExternalForm();
+ this.baseURL = task.getBasedir().toURI().toURL().toExternalForm();
} catch (MalformedURLException mfue) {
logger.error("Error creating base URL from base directory", mfue);
}
} else {
try {
if (task.getFofile() != null) {
- this.baseURL = task.getFofile().getParentFile().toURL().
+ this.baseURL = task.getFofile().getParentFile().toURI().toURL().
toExternalForm();
}
} catch (MalformedURLException mfue) {
@@ -519,11 +519,11 @@ class FOPTaskStarter {
try {
if (task.getRelativebase()) {
- this.baseURL = f.getParentFile().toURL().
+ this.baseURL = f.getParentFile().toURI().toURL().
toExternalForm();
}
if (this.baseURL == null) {
- this.baseURL = fs.getDir(task.getProject()).toURL().
+ this.baseURL = fs.getDir(task.getProject()).toURI().toURL().
toExternalForm();
}
diff --git a/src/java/org/apache/fop/tools/anttasks/RunTest.java b/src/java/org/apache/fop/tools/anttasks/RunTest.java
index b11c75242..2bc13e8b2 100644
--- a/src/java/org/apache/fop/tools/anttasks/RunTest.java
+++ b/src/java/org/apache/fop/tools/anttasks/RunTest.java
@@ -224,11 +224,11 @@ public class RunTest extends Task {
*/
private URL[] createUrls(String mainJar) throws MalformedURLException {
ArrayList urls = new ArrayList();
- urls.add(new File(mainJar).toURL());
+ urls.add(new File(mainJar).toURI().toURL());
File[] libFiles = new File("lib").listFiles();
for (int i = 0; i < libFiles.length; i++) {
if (libFiles[i].getPath().endsWith(".jar")) {
- urls.add(libFiles[i].toURL());
+ urls.add(libFiles[i].toURI().toURL());
}
}
return (URL[]) urls.toArray(new URL[urls.size()]);