diff --git a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java index d1025d9fd..ea4612f87 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java +++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java @@ -1661,18 +1661,28 @@ public class Javadoc extends Task { File packageListLocation = la.getPackagelistLoc(); if (packageListLocation == null) { throw new BuildException("The package list " - + " location for link " + la.getHref() - + " must be provided because the link is " - + "offline"); + + " location for link " + la.getHref() + + " must be provided because the link is " + + "offline"); } File packageListFile = new File(packageListLocation, "package-list"); if (packageListFile.exists()) { - toExecute.createArgument().setValue("-linkoffline"); - toExecute.createArgument().setValue(la.getHref()); - toExecute.createArgument() - .setValue(packageListLocation - .getAbsolutePath()); + try { + String packageListURL = + fileUtils.getFileURL(packageListLocation) + .toExternalForm(); + toExecute.createArgument() + .setValue("-linkoffline"); + toExecute.createArgument() + .setValue(la.getHref()); + toExecute.createArgument() + .setValue(packageListURL); + } catch (MalformedURLException ex) { + log("Warning: Package list location was " + + "invalid " + packageListLocation, + Project.MSG_WARN); + } } else { log("Warning: No package list was found at " + packageListLocation, Project.MSG_VERBOSE); @@ -1776,8 +1786,8 @@ public class Javadoc extends Task { .setValue("@" + tmpList.getAbsolutePath()); } srcListWriter = new PrintWriter( - new FileWriter(tmpList.getAbsolutePath(), - true)); + new FileWriter(tmpList.getAbsolutePath(), + true)); } Enumeration enum = packagesToDoc.elements();