diff --git a/docs/manual/CoreTasks/javadoc.html b/docs/manual/CoreTasks/javadoc.html index 9bd0d25a0..f4135edbc 100644 --- a/docs/manual/CoreTasks/javadoc.html +++ b/docs/manual/CoreTasks/javadoc.html @@ -550,7 +550,9 @@ specify multiple occurrences of the arguments.
boolean
value
+ */
+ public void setResolveLink(boolean resolve) {
+ this.resolveLink = resolve;
+ }
+
+ /**
+ * should Ant resolve the link attribute relative to the
+ * current basedir?
+ */
+ public boolean shouldResolveLink() {
+ return resolveLink;
+ }
+
}
/**
@@ -1756,11 +1775,28 @@ public class Javadoc extends Task {
log("No href was given for the link - skipping",
Project.MSG_VERBOSE);
continue;
- } else {
+ }
+ String link = null;
+ if (la.shouldResolveLink()) {
+ File hrefAsFile =
+ getProject().resolveFile(la.getHref());
+ if (hrefAsFile.exists()) {
+ try {
+ link = FILE_UTILS.getFileURL(hrefAsFile)
+ .toExternalForm();
+ } catch (MalformedURLException ex) {
+ // should be impossible
+ log("Warning: link location was invalid "
+ + hrefAsFile, Project.MSG_WARN);
+ }
+ }
+ }
+ if (link == null) {
// is the href a valid URL
try {
URL base = new URL("file://.");
new URL(base, la.getHref());
+ link = la.getHref();
} catch (MalformedURLException mue) {
// ok - just skip
log("Link href \"" + la.getHref()
@@ -1790,7 +1826,7 @@ public class Javadoc extends Task {
toExecute.createArgument()
.setValue("-linkoffline");
toExecute.createArgument()
- .setValue(la.getHref());
+ .setValue(link);
toExecute.createArgument()
.setValue(packageListURL);
} catch (MalformedURLException ex) {
@@ -1804,7 +1840,7 @@ public class Javadoc extends Task {
}
} else {
toExecute.createArgument().setValue("-link");
- toExecute.createArgument().setValue(la.getHref());
+ toExecute.createArgument().setValue(link);
}
}
}