From f5fb02e4934074f9b1ec52c7435e282231bae7bc Mon Sep 17 00:00:00 2001
From: Stefan Bodewig
Date: Fri, 13 Sep 2013 13:40:23 +0000
Subject: [PATCH] modernize a whole lot of links and example outputs - BZ 55551
- submitted by Erik Costlow
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1522924 13f79535-47bb-0310-9956-ffa450edef68
---
manual/Tasks/checksum.html | 5 +--
manual/Tasks/concat.html | 4 +--
manual/Tasks/ear.html | 6 ++--
manual/Tasks/echo.html | 2 +-
manual/Tasks/ejb.html | 2 +-
manual/Tasks/exec.html | 4 +--
manual/Tasks/ftp.html | 6 ++--
manual/Tasks/jarlib-available.html | 9 +++--
manual/Tasks/jarlib-display.html | 9 +++--
manual/Tasks/jarlib-manifest.html | 9 +++--
manual/Tasks/jarlib-resolve.html | 7 ++--
manual/Tasks/java.html | 2 +-
manual/Tasks/javadoc.html | 24 +++++++-------
manual/Tasks/javah.html | 4 +--
manual/Tasks/manifest.html | 8 ++---
manual/Tasks/mimemail.html | 2 +-
manual/Tasks/property.html | 12 +++----
manual/Tasks/sql.html | 2 +-
manual/Tasks/tstamp.html | 6 ++--
manual/Tasks/typedef.html | 2 +-
manual/Tasks/unzip.html | 4 +--
manual/Tasks/zip.html | 4 +--
manual/Types/assertions.html | 4 +--
manual/Types/extension.html | 6 ++--
manual/Types/extensionset.html | 4 +--
manual/Types/regexp.html | 2 +-
manual/Types/zipfileset.html | 4 +--
manual/install.html | 33 +++++++++----------
manual/properties.html | 6 ++--
manual/proxy.html | 9 ++---
manual/running.html | 5 ++-
src/etc/testcases/taskdefs/get.xml | 6 +++-
.../org/apache/tools/ant/taskdefs/Get.java | 27 +++++++++++++--
.../apache/tools/ant/taskdefs/GetTest.java | 4 +++
34 files changed, 131 insertions(+), 112 deletions(-)
diff --git a/manual/Tasks/checksum.html b/manual/Tasks/checksum.html
index 1754af7f6..29f48ddfd 100644
--- a/manual/Tasks/checksum.html
+++ b/manual/Tasks/checksum.html
@@ -48,7 +48,8 @@ Warning: the case of the extension is that of the algorithm used.
If you ask for "SHA1", you get a .SHA1 extension; if you ask for "sha1", you
get a file ending in .sha1. The Java Crypto Engines are case-insensitive
in matching algorithms, so choose a name to match your desired output extension,
-or set the fileext attribute.
+or set the fileext attribute. The names of common hashing algorithms can be located on the
+Cryptography Architecture Standard Algorithm Name Documentation
recentDateFormatConfig |
Specify in Java
-
+
SimpleDateFormat notation,
(e.g. MMM dd hh:mm ) the date format used by the FTP server
to parse dates less than a year old. If not specified (or specified as
diff --git a/manual/Tasks/jarlib-available.html b/manual/Tasks/jarlib-available.html
index 9e237edd0..adb732f03 100644
--- a/manual/Tasks/jarlib-available.html
+++ b/manual/Tasks/jarlib-available.html
@@ -33,11 +33,10 @@ If the extension is present then a property is set.
works with extensions as defined by the "Optional Package" specification.
For more information about optional packages, see the document
Optional Package Versioning in the documentation bundle for your
-Java2 Standard Edition package, in file
-guide/extensions/versioning.html or online at
-
-http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html
-See the Extension and ExtensionSet documentation for further details
+Java Standard Edition package, in file
+guide/extensions/versioning.html or the online
+
+Extension and ExtensionSet documentation for further details
Parameters
diff --git a/manual/Tasks/jarlib-display.html b/manual/Tasks/jarlib-display.html
index 6eb8eb303..0ddbaa34e 100644
--- a/manual/Tasks/jarlib-display.html
+++ b/manual/Tasks/jarlib-display.html
@@ -33,11 +33,10 @@
works with extensions as defined by the "Optional Package" specification.
For more information about optional packages, see the document
Optional Package Versioning in the documentation bundle for your
-Java2 Standard Edition package, in file
-guide/extensions/versioning.html or online at
-
-http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html
-See the Extension and ExtensionSet documentation for further details
+Java Standard Edition package, in file
+guide/extensions/versioning.html or the online
+
+Extension and ExtensionSet documentation for further details
Parameters
diff --git a/manual/Tasks/jarlib-manifest.html b/manual/Tasks/jarlib-manifest.html
index 70e133d10..019b55459 100644
--- a/manual/Tasks/jarlib-manifest.html
+++ b/manual/Tasks/jarlib-manifest.html
@@ -35,11 +35,10 @@
works with extensions as defined by the "Optional Package" specification.
For more information about optional packages, see the document
Optional Package Versioning in the documentation bundle for your
-Java2 Standard Edition package, in file
-guide/extensions/versioning.html or online at
-
-http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html
-See the Extension and ExtensionSet documentation for further details
+Java Standard Edition package, in file
+guide/extensions/versioning.html or the online
+
+Extension and ExtensionSet documentation for further details
Parameters
diff --git a/manual/Tasks/jarlib-resolve.html b/manual/Tasks/jarlib-resolve.html
index d168d8121..2ef4f87ba 100644
--- a/manual/Tasks/jarlib-resolve.html
+++ b/manual/Tasks/jarlib-resolve.html
@@ -39,10 +39,9 @@ works with extensions as defined by the "Optional Package" specification.
For more information about optional packages, see the document
Optional Package Versioning in the documentation bundle for your
Java2 Standard Edition package, in file
-guide/extensions/versioning.html or online at
-
-http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html
-See the Extension and ExtensionSet documentation for further details
+guide/extensions/versioning.html or the online
+
+Extension and ExtensionSet documentation for further details
Parameters
diff --git a/manual/Tasks/java.html b/manual/Tasks/java.html
index a237039c5..a83b0aff2 100644
--- a/manual/Tasks/java.html
+++ b/manual/Tasks/java.html
@@ -321,7 +321,7 @@ task is run. If you need to locate a JAR file relative to the directory
the task will be run in, you need to explicitly create the full path
to the JAR file.
When using the jar attribute, all classpath settings are
-ignored according to Sun's
+ignored according to Oracle's
specification.
diff --git a/manual/Tasks/javadoc.html b/manual/Tasks/javadoc.html
index 164adeb0e..31f3f3e38 100644
--- a/manual/Tasks/javadoc.html
+++ b/manual/Tasks/javadoc.html
@@ -61,7 +61,7 @@ to ensure that this command supports the attributes you wish to use.
Note: When generating the JavaDocs for classes which contains annotations
you maybe get a java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl.
-This is due bug-6442982. The cause is that JavaDoc cannot find the implementations of used annotations.
+This is due bug-6442982. The cause is that JavaDoc cannot find the implementations of used annotations.
The workaround is providing the jars with these implementations (like JAXBs @XmlType, ...)
to <javadoc> using classpath, classpathref attributes or nested
<classpath> element.
@@ -515,7 +515,7 @@ to <javadoc> using classpath, classpathref attributes or
order to mitigate CVE-2013-1571. Defaults to true. Since Ant
1.9.2
There is a frame injection attack possible in javadocs generated by Oracle
- JDKs prior to Java7 Update 25. When this flag is set to true, Ant
+ JDKs prior to Java7 Update 25 (details). When this flag is set to true, Ant
will check whether the docs are vulnerable and will try to fix them.
1.4 |
@@ -715,7 +715,7 @@ with text contents, and the packages may be listed with nested
doclet
The doclet nested element is used to specify the
-doclet
+doclet
that javadoc will use to process the input source files. A number of the standard javadoc arguments
are actually arguments of the standard doclet. If these are specified in the javadoc
task's attributes, they will be passed to the doclet specified in the
@@ -779,7 +779,7 @@ not set the description attribute for those tags.
If this attribute is specified, this element will behave as an implicit
fileset. The files included by this fileset should
contain each tag definition on a separate line, as described in the
- Javadoc reference guide:
+ Javadoc reference guide:
ejb.bean:t:XDoclet EJB Tag
todo:a:To Do
Note: The Javadoc reference quide has double quotes around
@@ -796,7 +796,7 @@ the javadoc program.
The taglet nested element is used to specify custom
- taglets.
+ taglets beyond the default taglets.
Parameters
@@ -808,7 +808,7 @@ the javadoc program.
name |
The name of the taglet class
- (e.g.
+ (e.g.
com.sun.tools.doclets.ToDoTaglet ) |
Yes |
@@ -849,8 +849,8 @@ arguments. Since Ant 1.6
<tag name="todo" scope="all" description="To do:"/>
<group title="Group 1 Packages" packages="com.dummy.test.a*"/>
<group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/>
- <link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/>
- <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
+ <link offline="true" href="http://docs.oracle.com/javase/7/docs/api/" packagelistLoc="C:\tmp"/>
+ <link href="http://docs.oracle.com/javase/7/docs/api/"/>
</javadoc>
is the same as
@@ -872,8 +872,8 @@ arguments. Since Ant 1.6
<tag name="todo" scope="all" description="To do:"/>
<group title="Group 1 Packages" packages="com.dummy.test.a*"/>
<group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/>
- <link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/>
- <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
+ <link offline="true" href="http://docs.oracle.com/javase/7/docs/api/" packagelistLoc="C:\tmp"/>
+ <link href="http://docs.oracle.com/javase/7/docs/api/"/>
</javadoc>
or
@@ -895,8 +895,8 @@ arguments. Since Ant 1.6
<tag name="todo" scope="all" description="To do:"/>
<group title="Group 1 Packages" packages="com.dummy.test.a*"/>
<group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/>
- <link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/>
- <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
+ <link offline="true" href="http://docs.oracle.com/javase/7/docs/api/" packagelistLoc="C:\tmp"/>
+ <link href="http://docs.oracle.com/javase/7/docs/api/"/>
</javadoc>
diff --git a/manual/Tasks/javah.html b/manual/Tasks/javah.html
index 306499f81..34a7b875a 100644
--- a/manual/Tasks/javah.html
+++ b/manual/Tasks/javah.html
@@ -29,8 +29,8 @@
Generates JNI headers from a Java class.
When this task executes, it will generate the C header and source files that
are needed to implement native methods. JNI operates differently depending on
-whether JDK1.2
-(or later) or pre-JDK1.2
+whether JDK1.2+
+or pre-JDK1.2
systems are used.
It is possible to use different compilers. This can be selected
diff --git a/manual/Tasks/manifest.html b/manual/Tasks/manifest.html
index 457eb3bb3..7a5b98bcd 100644
--- a/manual/Tasks/manifest.html
+++ b/manual/Tasks/manifest.html
@@ -34,7 +34,7 @@ replacing or updating an existing file.
Manifests are processed according to the
-Jar
+Jar
file specification.. Specifically, a manifest element consists of
a set of attributes and sections. These sections in turn may contain
attributes. Note in particular that this may result in manifest lines
@@ -169,21 +169,21 @@ href="#attribute">attribute elements into sections.
attribute will take the value of the Ant property ${user.name}. The
same is true for the ${version} and ${TODAY} properties. This example
produces a MANIFEST.MF that contains
-package
+package
version identification for the package common .
The manifest produced by the above would look like this:
Manifest-Version: 1.0
Built-By: bodewig
-Created-By: Apache Ant 1.7
+Created-By: Apache Ant 1.9
Name: common
Specification-Title: Example
Specification-Vendor: Example Organization
Implementation-Vendor: Example Corp.
Specification-Version: 1.2
-Implementation-Version: 1.2 February 19 2006
+Implementation-Version: 1.2 September 10, 2013
Implementation-Title: common
Name: common/class1.class
diff --git a/manual/Tasks/mimemail.html b/manual/Tasks/mimemail.html
index c0ec7b551..ba066a6b6 100644
--- a/manual/Tasks/mimemail.html
+++ b/manual/Tasks/mimemail.html
@@ -31,7 +31,7 @@
Description
Sends SMTP mail with MIME attachments.
-JavaMail
+JavaMail
and Java
Activation Framework are required for this task.
Multiple files can be attached using FileSets.
diff --git a/manual/Tasks/property.html b/manual/Tasks/property.html
index 16aa06db3..7d0c48532 100644
--- a/manual/Tasks/property.html
+++ b/manual/Tasks/property.html
@@ -269,12 +269,10 @@ about this feature
If the file is not there, nothing is printed except at -verbose log
level. This lets you have optional configuration files for every
project, that team members can customize.
-The rules for this format are laid down
-by Sun.
-This makes it hard for Team Ant to field bug reports about it.
-Trailing spaces are not stripped. It may have been what you wanted.
-Want unusual characters? Escape them \u0456 or \" style.
-Ant Properties are expanded in the file
+The rules for this format match java.util.Properties.
+Trailing spaces are not stripped. It may have been what you wanted.
+Want unusual characters? Escape them \u0456 or \" style.
+Ant Properties are expanded in the file
If you want to expand properties defined inside the same file and
you use the prefix attribute of the task, you must use the same
prefix when expanding the properties or
@@ -294,7 +292,7 @@ deploy.url=http://${deploy.server}:${deploy.port}/
Notes about environment variables
- Ant runs on Java 1.2 therefore it cant use Java5 features for accessing environment
+ Ant runs on Java 1.2 therefore it cannot use Java5 features for accessing environment
variables. So it starts a command in a new process which prints the environment variables,
analyzes the output and creates the properties.
There are commands for the following operating systems implemented in
diff --git a/manual/Tasks/sql.html b/manual/Tasks/sql.html
index 4f6e4e4d4..84dc1279d 100644
--- a/manual/Tasks/sql.html
+++ b/manual/Tasks/sql.html
@@ -180,7 +180,7 @@ and abort execution and transaction and fail task.
Control whether the Java statement
object will perform escape substitution.
See Statement's
+ href="http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#setEscapeProcessing%28boolean%29">Statement's
API docs for details. Since Ant 1.6.
| No (default=true) |
diff --git a/manual/Tasks/tstamp.html b/manual/Tasks/tstamp.html
index c1930a000..82812a579 100644
--- a/manual/Tasks/tstamp.html
+++ b/manual/Tasks/tstamp.html
@@ -58,7 +58,7 @@ probably in an initialization target.
The Tstamp task supports a <format> nested element that
allows a property to be set to the current date and time in a given format.
The date/time patterns are as defined in the Java
-SimpleDateFormat class.
+SimpleDateFormat class.
The format element also allows offsets to be applied to the time to generate different time values.
@@ -81,7 +81,7 @@ The format element also allows offsets to be applied to the time to generate dif
timezone |
- The timezone to use for displaying time. The values are as defined by the Java TimeZone class. |
+ The timezone to use for displaying time. The values are as defined by the Java TimeZone class. |
No |
@@ -112,7 +112,7 @@ The format element also allows offsets to be applied to the time to generate dif
form is "language, country, variant" but either variant or variant and
country may be omitted. For more information please refer to documentation
for the
- Locale
+ Locale
class.
No |
diff --git a/manual/Tasks/typedef.html b/manual/Tasks/typedef.html
index 524390a65..bdd58a7f7 100644
--- a/manual/Tasks/typedef.html
+++ b/manual/Tasks/typedef.html
@@ -65,7 +65,7 @@
If you are defining tasks or types that share the same classpath
with multiple taskdef or typedef tasks, the corresponding classes
will be loaded by different
- Java ClassLoaders.
+ Java ClassLoaders.
Two classes with the same name loaded via different ClassLoaders
are not the same class from the point of view of the Java VM, they
don't share static variables and instances of these classes can't
diff --git a/manual/Tasks/unzip.html b/manual/Tasks/unzip.html
index f88f8597d..02df7acf9 100644
--- a/manual/Tasks/unzip.html
+++ b/manual/Tasks/unzip.html
@@ -103,8 +103,8 @@ archive.
Note: This attribute is not available for
the untar task.
The character encoding that has been used for filenames
- inside the zip file. For a list of possible values see http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html.
+ inside the zip file. For a list of possible values see the Supported Encodings.
Defaults to "UTF8", use the magic value
native-encoding for the platform's default character
encoding.
diff --git a/manual/Tasks/zip.html b/manual/Tasks/zip.html
index 7ef9f0ce0..4d66851aa 100644
--- a/manual/Tasks/zip.html
+++ b/manual/Tasks/zip.html
@@ -148,8 +148,8 @@ archive.
|
encoding |
The character encoding to use for filenames
- inside the zip file. For a list of possible values see http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html.
+ inside the zip file. For a list of possible values see the Supported Encodings.
Defaults to the platform's default character encoding.
See also the discussion below |
No |
diff --git a/manual/Types/assertions.html b/manual/Types/assertions.html
index bbf823a3a..e168969fd 100644
--- a/manual/Types/assertions.html
+++ b/manual/Types/assertions.html
@@ -33,9 +33,9 @@ in <java> and
Assertions are covered in the
-J2SDK 1.4 documentation,
+Java SE documentation,
and the
-Java Language Specification.
+Java Language Specification.
The key points to note are that a java.lang.AssertionError
diff --git a/manual/Types/extension.html b/manual/Types/extension.html
index 4f9943712..b05c0a65c 100644
--- a/manual/Types/extension.html
+++ b/manual/Types/extension.html
@@ -31,9 +31,9 @@ works with extensions as defined by the "Optional Package" specification.
For more information about optional packages, see the document
Optional Package Versioning in the documentation bundle for your
Java2 Standard Edition package, in file
-guide/extensions/versioning.html or online at
-
-http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html.
+guide/extensions/versioning.html or the online
+
+Package Versioning documentation.
Attributes
The extension type supports the following attributes :
diff --git a/manual/Types/extensionset.html b/manual/Types/extensionset.html
index fdebd0429..f38c1ed1d 100644
--- a/manual/Types/extensionset.html
+++ b/manual/Types/extensionset.html
@@ -30,8 +30,8 @@ works with extensions as defined by the "Optional Package" specification.
Optional Package Versioning in the documentation bundle for your
Java2 Standard Edition package, in file
guide/extensions/versioning.html or online at
-
-http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html.
+
+Package Versioning documentation.
Nested Elements
diff --git a/manual/Types/regexp.html b/manual/Types/regexp.html
index b6b0482ee..0628bb9ba 100644
--- a/manual/Types/regexp.html
+++ b/manual/Types/regexp.html
@@ -58,7 +58,7 @@ Use the regular expression with id myregexp.
Apache Ant comes with
wrappers for
-the java.util.regex package,
+the java.util.regex package,
jakarta-regexp
and jakarta-ORO,
See installation dependencies
diff --git a/manual/Types/zipfileset.html b/manual/Types/zipfileset.html
index c29a8dad7..8541dfda6 100644
--- a/manual/Types/zipfileset.html
+++ b/manual/Types/zipfileset.html
@@ -92,8 +92,8 @@ directories. Default is 755. since Ant 1.5.2.
encoding |
The character encoding to use for filenames
- inside the zip file. For a list of possible values see http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html.
+ inside the zip file. For a list of possible values see the Supported Encodings.
Defaults to the platform's default character encoding.
Only supported by zipfileset. |
No |
diff --git a/manual/install.html b/manual/install.html
index 552a555fa..507b2c809 100644
--- a/manual/install.html
+++ b/manual/install.html
@@ -238,8 +238,8 @@ that tend to work best. As of Ant1.7, Windows 9x is no longer supported.
For the current version of Ant, you will also need a JDK installed on
-your system, version 1.4 or later required, 1.5 or later strongly recommended.
-The later the version of Java , the more Ant tasks you get.
+your system, version 1.4 or later required, 1.7 or later strongly recommended.
+The more up-to-date the version of Java , the more Ant tasks you get.
Note: If a JDK is not present, only the JRE runtime, then many tasks will not work.
@@ -252,10 +252,9 @@ The later the version of Java , the more Ant tasks you get.
Open Source Java Runtimes
- The Ant team strongly supports users running Ant on Kaffe and other
+ The Ant team strongly supports users running Ant on OpenJDK and other
open source Java runtimes, and so strives to have a product that works
- well on those platforms. What appears to work well is Kaffe with
- Gnu Classpath and the Xerces and Xalan libraries.
+ well on those platforms.
@@ -369,7 +368,7 @@ Build failed
So Ant works. This message is there because you need to write an individual buildfile for your
project. With a ant -version you should get an output like
-Apache Ant version 1.7.1 compiled on June 27 2008
+Apache Ant(TM) version 1.9.2 compiled on July 8 2013
If this does not work ensure your environment variables are set right. They must resolve to:
@@ -448,7 +447,7 @@ libraries must be added to Ant's classpath, in any of the following ways:
ant -f fetch.xml -Ddest=[option]
-
where option is one of the following, as described above:
@@ -552,10 +551,10 @@ this.
-- With Java1.5
+ - With Java1.5 or above
-When you run Ant on Java1.5, you could try to use the automatic proxy setup
+When you run Ant on Java1.5 or above, you could try to use the automatic proxy setup
mechanism with -autoproxy .
@@ -563,8 +562,8 @@ mechanism with -autoproxy .
- With explicit JVM properties.
-These are documented by Oracle,
+These are documented in Java's Networking Properties,
and control the proxy behaviour of the entire JVM. To set them in Ant, declare
them in the ANT_OPTS environment variable. This is the best option
for a non-mobile system. For a laptop, you have to change these settings as you
@@ -629,19 +628,19 @@ configuring the JVM properties until they are happy.
Assume Ant is installed in c:\ant\ . The following sets up the
environment:
set ANT_HOME=c:\ant
-set JAVA_HOME=c:\jdk-1.5.0.05
+set JAVA_HOME=c:\jdk1.7.0_51
set PATH=%PATH%;%ANT_HOME%\bin
Assume Ant is installed in /usr/local/ant . The following sets up
the environment:
export ANT_HOME=/usr/local/ant
-export JAVA_HOME=/usr/local/jdk-1.5.0.05
+export JAVA_HOME=/usr/local/jdk1.7.0_51
export PATH=${PATH}:${ANT_HOME}/bin
setenv ANT_HOME /usr/local/ant
-setenv JAVA_HOME /usr/local/jdk/jdk-1.5.0.05
+setenv JAVA_HOME /usr/local/jdk/jdk1.7.0_51
set path=( $path $ANT_HOME/bin )
@@ -732,7 +731,7 @@ See Installing Ant
for examples on how to do this for your operating system.
Note: The bootstrap process of Ant requires a greedy
-compiler like Sun's javac or jikes. It does not work with gcj or
+compiler like OpenJDK or Oracle's javac. It does not work with gcj or
kjc.
Make sure you have downloaded any auxiliary jars required to
@@ -986,8 +985,8 @@ you need jakarta-oro 2.0.8 or later, and commons-net<
mail.jar |
Mail task with Mime encoding, and the MimeMail task |
- http://www.oracle.com/technetwork/java/index-jsp-139225.html |
+ http://www.oracle.com/technetwork/java/index-138643.html |
activation.jar |
diff --git a/manual/properties.html b/manual/properties.html
index cef00bfb4..c0ac0c496 100644
--- a/manual/properties.html
+++ b/manual/properties.html
@@ -57,7 +57,7 @@
example, ${os.name} expands to the name of the
operating system.
For a list of system properties see
- the Javadoc of System.getProperties.
+ the Javadoc of System.getProperties.
In addition, Ant has some built-in properties:
@@ -78,8 +78,8 @@ ant.project.invoked-targets
an <ant> task ...) when invoking the current
project.
ant.java.version the JVM version Ant detected; currently it can hold
- the values "1.2", "1.3",
- "1.4", "1.5" and "1.6".
+ the values "1.7", "1.6", "1.5",
+ "1.4", "1.3" and "1.2".
ant.core.lib the absolute path of the ant.jar file.
diff --git a/manual/proxy.html b/manual/proxy.html
index b6f730bb1..13ef6e8ed 100644
--- a/manual/proxy.html
+++ b/manual/proxy.html
@@ -87,8 +87,7 @@ proxy configuration.
How Autoproxy works
-We are grateful for some input from Sun as to how the proxy code works under
-Java 1.5 and up. The java.net.useSystemProxies is checked only
+The java.net.useSystemProxies is checked only
once, at startup time, the other checks (registry, gconf, system properties) are done
dynamically whenever needed (socket connection, URL connection etc..).
@@ -284,10 +283,8 @@ use one of the alternate mechanisms to configure the JVM.
Further reading
diff --git a/manual/running.html b/manual/running.html
index ef7d73bab..46005b553 100644
--- a/manual/running.html
+++ b/manual/running.html
@@ -425,7 +425,7 @@ org.apache.tools.ant.Executor implementation specified here.
name of a supported character set (e.g. UTF-8, ISO-8859-1, US-ASCII) |
use as default character set of email messages; use as default for source-, dest- and bundleencoding
in translate
- see JavaDoc of java.nio.charset.Charset
+ see JavaDoc of java.nio.charset.Charset
for more information about character sets (not used in Ant, but has nice docs).
|
@@ -602,8 +602,7 @@ Here is an example:
failonerror="true"
dir="${sub.builddir}"
timeout="4000000"
- taskname="startAnt"
->
+ taskname="startAnt">
<classpath>
<pathelement location="${ant.home}/lib/ant-launcher.jar"/>
</classpath>
diff --git a/src/etc/testcases/taskdefs/get.xml b/src/etc/testcases/taskdefs/get.xml
index 029624468..b74e92ab2 100644
--- a/src/etc/testcases/taskdefs/get.xml
+++ b/src/etc/testcases/taskdefs/get.xml
@@ -39,7 +39,7 @@
-
+
@@ -53,6 +53,10 @@
+
+
+
+
diff --git a/src/main/org/apache/tools/ant/taskdefs/Get.java b/src/main/org/apache/tools/ant/taskdefs/Get.java
index 76de5fe52..70529e69d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Get.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Get.java
@@ -31,6 +31,7 @@ import java.net.URLConnection;
import java.util.Date;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Main;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Mapper;
@@ -65,6 +66,8 @@ public class Get extends Task {
private static final String HTTP = "http";
private static final String HTTPS = "https";
+ private static final String DEFAULT_AGENT_PREFIX = "Apache Ant";
+
private Resources sources = new Resources();
private File destination; // required
private boolean verbose = false;
@@ -77,6 +80,7 @@ public class Get extends Task {
private boolean skipExisting = false;
private boolean httpUseCaches = true; // on by default
private Mapper mapperElement = null;
+ private String userAgent = System.getProperty("http.agent", DEFAULT_AGENT_PREFIX + "/" + Main.getAntVersion());
/**
* Does the work.
@@ -216,7 +220,7 @@ public class Get extends Task {
GetThread getThread = new GetThread(source, dest,
hasTimestamp, timestamp, progress,
- logLevel);
+ logLevel, userAgent);
getThread.setDaemon(true);
getProject().registerThreadTask(getThread, this);
getThread.start();
@@ -247,6 +251,11 @@ public class Get extends Task {
* Check the attributes.
*/
private void checkAttributes() {
+
+ if (userAgent == null || userAgent.trim().length() == 0) {
+ throw new BuildException("userAgent may not be null or empty");
+ }
+
if (sources.size() == 0) {
throw new BuildException("at least one source is required",
getLocation());
@@ -411,6 +420,16 @@ public class Get extends Task {
public void setHttpUseCaches(boolean httpUseCache) {
this.httpUseCaches = httpUseCache;
}
+
+ /**
+ * HTTP connections only - set the user-agent to be used
+ * when communicating with remote server. if null, then
+ * the value is considered unset and the behaviour falls
+ * back to the default of the http API.
+ */
+ public void setUserAgent(String userAgent) {
+ this.userAgent = userAgent;
+ }
/**
* Define the mapper to map source to destination files.
@@ -553,15 +572,17 @@ public class Get extends Task {
private OutputStream os = null;
private URLConnection connection;
private int redirections = 0;
-
+ private String userAgent = null;
+
GetThread(URL source, File dest,
- boolean h, long t, DownloadProgress p, int l) {
+ boolean h, long t, DownloadProgress p, int l, String userAgent) {
this.source = source;
this.dest = dest;
hasTimestamp = h;
timestamp = t;
progress = p;
logLevel = l;
+ this.userAgent = userAgent;
}
public void run() {
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java
index dd01d0eab..a81c29c96 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/GetTest.java
@@ -60,6 +60,10 @@ public class GetTest extends BuildFileTest {
executeTarget("test6");
}
+ public void test7() {
+ expectBuildException("test7", "userAgent may not be null or empty");
+ }
+
public void testUseTimestamp() {
executeTarget("testUseTimestamp");
}
| |