git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@476580 13f79535-47bb-0310-9956-ffa450edef68master
@@ -36,6 +36,9 @@ import org.apache.tools.bzip2.CBZip2OutputStream; | |||||
*/ | */ | ||||
public class BZip2 extends Pack { | public class BZip2 extends Pack { | ||||
/** | |||||
* Compress the zipFile. | |||||
*/ | |||||
protected void pack() { | protected void pack() { | ||||
CBZip2OutputStream zOut = null; | CBZip2OutputStream zOut = null; | ||||
try { | try { | ||||
@@ -59,7 +59,7 @@ import org.apache.tools.ant.util.StringUtils; | |||||
*/ | */ | ||||
public class Checksum extends MatchingTask implements Condition { | public class Checksum extends MatchingTask implements Condition { | ||||
private static class FileUnion extends Restrict { | private static class FileUnion extends Restrict { | ||||
Union u; | |||||
private Union u; | |||||
FileUnion() { | FileUnion() { | ||||
u = new Union(); | u = new Union(); | ||||
super.add(u); | super.add(u); | ||||
@@ -52,6 +52,9 @@ public class Chmod extends ExecuteOn { | |||||
} | } | ||||
/** | /** | ||||
* Set the project of this task. | |||||
* Calls the super class and sets the project on dhe default FileSet. | |||||
* @param project the project for this task. | |||||
* @see org.apache.tools.ant.ProjectComponent#setProject | * @see org.apache.tools.ant.ProjectComponent#setProject | ||||
*/ | */ | ||||
public void setProject(Project project) { | public void setProject(Project project) { | ||||
@@ -95,17 +95,26 @@ public class Classloader extends Task { | |||||
this.reset = b; | this.reset = b; | ||||
} | } | ||||
/** | |||||
* Set reverse attribute. | |||||
* @param b if true reverse the normal classloader lookup. | |||||
*/ | |||||
public void setReverse(boolean b) { | public void setReverse(boolean b) { | ||||
this.parentFirst = !b; | this.parentFirst = !b; | ||||
} | } | ||||
/** | |||||
* Set reverse attribute. | |||||
* @param b if true reverse the normal classloader lookup. | |||||
*/ | |||||
public void setParentFirst(boolean b) { | public void setParentFirst(boolean b) { | ||||
this.parentFirst = b; | this.parentFirst = b; | ||||
} | } | ||||
// TODO: add exceptions for delegation or reverse | |||||
// TODO | |||||
/** | |||||
* Set the name of the parent. | |||||
* @param name the parent name. | |||||
*/ | |||||
public void setParentName(String name) { | public void setParentName(String name) { | ||||
this.parentName = name; | this.parentName = name; | ||||
} | } | ||||
@@ -114,6 +123,8 @@ public class Classloader extends Task { | |||||
/** Specify which path will be used. If the loader already exists | /** Specify which path will be used. If the loader already exists | ||||
* and is an AntClassLoader (or any other loader we can extend), | * and is an AntClassLoader (or any other loader we can extend), | ||||
* the path will be added to the loader. | * the path will be added to the loader. | ||||
* @param pathRef a reference to a path. | |||||
* @throws BuildException if there is a problem. | |||||
*/ | */ | ||||
public void setClasspathRef(Reference pathRef) throws BuildException { | public void setClasspathRef(Reference pathRef) throws BuildException { | ||||
classpath = (Path) pathRef.getReferencedObject(getProject()); | classpath = (Path) pathRef.getReferencedObject(getProject()); | ||||
@@ -132,6 +143,10 @@ public class Classloader extends Task { | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Create a classpath. | |||||
* @return a path for configuration. | |||||
*/ | |||||
public Path createClasspath() { | public Path createClasspath() { | ||||
if (this.classpath == null) { | if (this.classpath == null) { | ||||
this.classpath = new Path(null); | this.classpath = new Path(null); | ||||
@@ -140,6 +155,9 @@ public class Classloader extends Task { | |||||
} | } | ||||
/** | |||||
* do the classloader manipulation. | |||||
*/ | |||||
public void execute() { | public void execute() { | ||||
try { | try { | ||||
// Gump friendly - don't mess with the core loader if only classpath | // Gump friendly - don't mess with the core loader if only classpath | ||||
@@ -116,10 +116,22 @@ public class CopyPath extends Task { | |||||
return path; | return path; | ||||
} | } | ||||
/** | |||||
* Set the number of milliseconds leeway to give before deciding a | |||||
* target is out of date. | |||||
* TODO: This is not yet used. | |||||
* @param granularity the granularity used to decide if a target is out of | |||||
* date. | |||||
*/ | |||||
public void setGranularity(long granularity) { | public void setGranularity(long granularity) { | ||||
this.granularity = granularity; | this.granularity = granularity; | ||||
} | } | ||||
/** | |||||
* Give the copied files the same last modified time as the original files. | |||||
* @param preserveLastModified if true preserve the modified time; | |||||
* default is false. | |||||
*/ | |||||
public void setPreserveLastModified(boolean preserveLastModified) { | public void setPreserveLastModified(boolean preserveLastModified) { | ||||
this.preserveLastModified = preserveLastModified; | this.preserveLastModified = preserveLastModified; | ||||
} | } | ||||
@@ -83,8 +83,8 @@ public class Delete extends MatchingTask { | |||||
return ((Comparable) foo).compareTo(bar) * -1; | return ((Comparable) foo).compareTo(bar) * -1; | ||||
} | } | ||||
}; | }; | ||||
File basedir; | |||||
String[] dirs; | |||||
private File basedir; | |||||
private String[] dirs; | |||||
ReverseDirs(File basedir, String[] dirs) { | ReverseDirs(File basedir, String[] dirs) { | ||||
this.basedir = basedir; | this.basedir = basedir; | ||||
this.dirs = dirs; | this.dirs = dirs; | ||||
@@ -68,6 +68,7 @@ public class ExecuteWatchdog implements TimeoutObserver { | |||||
} | } | ||||
/** | /** | ||||
* @param timeout the timeout value to use in milliseconds. | |||||
* @see #ExecuteWatchdog(long) | * @see #ExecuteWatchdog(long) | ||||
* @deprecated since 1.5.x. | * @deprecated since 1.5.x. | ||||
* Use constructor with a long type instead. | * Use constructor with a long type instead. | ||||
@@ -343,22 +343,26 @@ public class Get extends Task { | |||||
extends org.apache.tools.ant.util.Base64Converter { | extends org.apache.tools.ant.util.Base64Converter { | ||||
} | } | ||||
/** | |||||
* Interface implemented for reporting | |||||
* progess of downloading. | |||||
*/ | |||||
public interface DownloadProgress { | public interface DownloadProgress { | ||||
/** | /** | ||||
* begin a download | * begin a download | ||||
*/ | */ | ||||
public void beginDownload(); | |||||
void beginDownload(); | |||||
/** | /** | ||||
* tick handler | * tick handler | ||||
* | * | ||||
*/ | */ | ||||
public void onTick(); | |||||
void onTick(); | |||||
/** | /** | ||||
* end a download | * end a download | ||||
*/ | */ | ||||
public void endDownload(); | |||||
void endDownload(); | |||||
} | } | ||||
/** | /** | ||||
@@ -393,8 +397,14 @@ public class Get extends Task { | |||||
*/ | */ | ||||
public static class VerboseProgress implements DownloadProgress { | public static class VerboseProgress implements DownloadProgress { | ||||
private int dots = 0; | private int dots = 0; | ||||
// CheckStyle:VisibilityModifier OFF - bc | |||||
PrintStream out; | PrintStream out; | ||||
// CheckStyle:VisibilityModifier ON | |||||
/** | |||||
* Construct a verbose progress reporter. | |||||
* @param out the output stream. | |||||
*/ | |||||
public VerboseProgress(PrintStream out) { | public VerboseProgress(PrintStream out) { | ||||
this.out = out; | this.out = out; | ||||
} | } | ||||
@@ -127,7 +127,7 @@ public class Input extends Task { | |||||
new PropertyFileInputHandler(), | new PropertyFileInputHandler(), | ||||
new GreedyInputHandler()}; | new GreedyInputHandler()}; | ||||
//inherit doc | |||||
/** {@inheritDoc} */ | |||||
public String[] getValues() { | public String[] getValues() { | ||||
return VALUES; | return VALUES; | ||||
} | } | ||||
@@ -144,11 +144,13 @@ public class Jar extends Zip { | |||||
* | * | ||||
* @since Ant 1.6.3 | * @since Ant 1.6.3 | ||||
*/ | */ | ||||
private ZipExtraField[] JAR_MARKER = new ZipExtraField[] { | |||||
private static final ZipExtraField[] JAR_MARKER = new ZipExtraField[] { | |||||
JarMarker.getInstance() | JarMarker.getInstance() | ||||
}; | }; | ||||
// CheckStyle:VisibilityModifier OFF - bc | |||||
protected String emptyBehavior = "create"; | protected String emptyBehavior = "create"; | ||||
// CheckStyle:VisibilityModifier ON | |||||
/** constructor */ | /** constructor */ | ||||
public Jar() { | public Jar() { | ||||
@@ -261,11 +261,15 @@ public class Length extends Task implements Condition { | |||||
} | } | ||||
private abstract class Handler { | private abstract class Handler { | ||||
PrintStream ps; | |||||
private PrintStream ps; | |||||
Handler(PrintStream ps) { | Handler(PrintStream ps) { | ||||
this.ps = ps; | this.ps = ps; | ||||
} | } | ||||
protected PrintStream getPs() { | |||||
return ps; | |||||
} | |||||
protected abstract void handle(Resource r); | protected abstract void handle(Resource r); | ||||
void complete() { | void complete() { | ||||
@@ -278,14 +282,14 @@ public class Length extends Task implements Condition { | |||||
super(ps); | super(ps); | ||||
} | } | ||||
protected void handle(Resource r) { | protected void handle(Resource r) { | ||||
ps.print(r.toString()); | |||||
ps.print(" : "); | |||||
getPs().print(r.toString()); | |||||
getPs().print(" : "); | |||||
//when writing to the log, we'll see what's happening: | //when writing to the log, we'll see what's happening: | ||||
long size = r.getSize(); | long size = r.getSize(); | ||||
if (size == Resource.UNKNOWN_SIZE) { | if (size == Resource.UNKNOWN_SIZE) { | ||||
ps.println("unknown"); | |||||
getPs().println("unknown"); | |||||
} else { | } else { | ||||
ps.println(size); | |||||
getPs().println(size); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -295,6 +299,9 @@ public class Length extends Task implements Condition { | |||||
AllHandler(PrintStream ps) { | AllHandler(PrintStream ps) { | ||||
super(ps); | super(ps); | ||||
} | } | ||||
protected long getAccum() { | |||||
return accum; | |||||
} | |||||
protected synchronized void handle(Resource r) { | protected synchronized void handle(Resource r) { | ||||
long size = r.getSize(); | long size = r.getSize(); | ||||
if (size == Resource.UNKNOWN_SIZE) { | if (size == Resource.UNKNOWN_SIZE) { | ||||
@@ -304,7 +311,7 @@ public class Length extends Task implements Condition { | |||||
} | } | ||||
} | } | ||||
void complete() { | void complete() { | ||||
ps.print(accum); | |||||
getPs().print(accum); | |||||
super.complete(); | super.complete(); | ||||
} | } | ||||
} | } | ||||
@@ -316,7 +323,7 @@ public class Length extends Task implements Condition { | |||||
void complete() { | void complete() { | ||||
} | } | ||||
long getLength() { | long getLength() { | ||||
return accum; | |||||
return getAccum(); | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -51,10 +51,9 @@ public class LoadResource extends Task { | |||||
private boolean failOnError = true; | private boolean failOnError = true; | ||||
/** | /** | ||||
* suppress error message if it goes pear-shaped, sets failOnError=false | |||||
* suppress error message if it goes pear-shaped, sets failOnError=false | |||||
*/ | */ | ||||
private boolean quiet = false; | private boolean quiet = false; | ||||
/** | /** | ||||
* Encoding to use for filenames, defaults to the platform's default | * Encoding to use for filenames, defaults to the platform's default | ||||
@@ -106,7 +105,7 @@ public class LoadResource extends Task { | |||||
public final void setFailonerror(final boolean fail) { | public final void setFailonerror(final boolean fail) { | ||||
failOnError = fail; | failOnError = fail; | ||||
} | } | ||||
/** | /** | ||||
* If true, suppress the load error report and set the | * If true, suppress the load error report and set the | ||||
* the failonerror value to false. | * the failonerror value to false. | ||||
@@ -116,6 +116,7 @@ public abstract class MatchingTask extends Task implements SelectorContainer { | |||||
fileset.setIncludes(includes); | fileset.setIncludes(includes); | ||||
} | } | ||||
// CheckStyle:MethodNameCheck OFF - bc | |||||
/** | /** | ||||
* Set this to be the items in the base directory that you want to be | * Set this to be the items in the base directory that you want to be | ||||
* included. You can also specify "*" for the items (ie: items="*") | * included. You can also specify "*" for the items (ie: items="*") | ||||
@@ -168,6 +169,8 @@ public abstract class MatchingTask extends Task implements SelectorContainer { | |||||
} | } | ||||
} | } | ||||
// CheckStyle:VisibilityModifier ON | |||||
/** | /** | ||||
* Sets whether default exclusions should be used or not. | * Sets whether default exclusions should be used or not. | ||||
* | * | ||||
@@ -58,8 +58,8 @@ public class Redirector { | |||||
= System.getProperty("file.encoding"); | = System.getProperty("file.encoding"); | ||||
private class PropertyOutputStream extends ByteArrayOutputStream { | private class PropertyOutputStream extends ByteArrayOutputStream { | ||||
String property; | |||||
boolean closed = false; | |||||
private String property; | |||||
private boolean closed = false; | |||||
PropertyOutputStream(String property) { | PropertyOutputStream(String property) { | ||||
super(); | super(); | ||||
@@ -46,6 +46,7 @@ import org.apache.tools.ant.util.FileNameMapper; | |||||
* @since Ant 1.1 | * @since Ant 1.1 | ||||
*/ | */ | ||||
public class SignJar extends AbstractJarSignerTask { | public class SignJar extends AbstractJarSignerTask { | ||||
// CheckStyle:VisibilityModifier OFF - bc | |||||
private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); | ||||
@@ -131,6 +132,7 @@ public class SignJar extends AbstractJarSignerTask { | |||||
* error string for unit test verification: {@value} | * error string for unit test verification: {@value} | ||||
*/ | */ | ||||
public static final String ERROR_NO_STOREPASS = "storepass attribute must be set"; | public static final String ERROR_NO_STOREPASS = "storepass attribute must be set"; | ||||
// CheckStyle:VisibilityModifier ON | |||||
/** | /** | ||||
* name of .SF/.DSA file; optional | * name of .SF/.DSA file; optional | ||||
@@ -125,6 +125,7 @@ public class StreamPumper implements Runnable { | |||||
/** | /** | ||||
* This method blocks until the stream pumper finishes. | * This method blocks until the stream pumper finishes. | ||||
* @throws InterruptedException if interrupted. | |||||
* @see #isFinished() | * @see #isFinished() | ||||
*/ | */ | ||||
public synchronized void waitFor() | public synchronized void waitFor() | ||||
@@ -62,6 +62,8 @@ public class Sync extends Task { | |||||
// Override Task#init | // Override Task#init | ||||
/** | /** | ||||
* Initialize the sync task. | |||||
* @throws BuildException if there is a problem. | |||||
* @see Task#init() | * @see Task#init() | ||||
*/ | */ | ||||
public void init() | public void init() | ||||
@@ -85,6 +87,8 @@ public class Sync extends Task { | |||||
// Override Task#execute | // Override Task#execute | ||||
/** | /** | ||||
* Execute the sync task. | |||||
* @throws BuildException if there is an error. | |||||
* @see Task#execute() | * @see Task#execute() | ||||
*/ | */ | ||||
public void execute() | public void execute() | ||||
@@ -368,6 +372,7 @@ public class Sync extends Task { | |||||
/** | /** | ||||
* @see Copy#scan(File, File, String[], String[]) | * @see Copy#scan(File, File, String[], String[]) | ||||
*/ | */ | ||||
/** {@inheritDoc} */ | |||||
protected void scan(File fromDir, File toDir, String[] files, | protected void scan(File fromDir, File toDir, String[] files, | ||||
String[] dirs) { | String[] dirs) { | ||||
assertTrue("No mapper", mapperElement == null); | assertTrue("No mapper", mapperElement == null); | ||||
@@ -385,6 +390,7 @@ public class Sync extends Task { | |||||
/** | /** | ||||
* @see Copy#scan(Resource[], File) | * @see Copy#scan(Resource[], File) | ||||
*/ | */ | ||||
/** {@inheritDoc} */ | |||||
protected Map scan(Resource[] resources, File toDir) { | protected Map scan(Resource[] resources, File toDir) { | ||||
assertTrue("No mapper", mapperElement == null); | assertTrue("No mapper", mapperElement == null); | ||||
@@ -90,6 +90,7 @@ public class Tar extends MatchingTask { | |||||
*/ | */ | ||||
public static final String OMIT = "omit"; | public static final String OMIT = "omit"; | ||||
// CheckStyle:VisibilityModifier OFF - bc | |||||
File tarFile; | File tarFile; | ||||
File baseDir; | File baseDir; | ||||
@@ -103,6 +104,8 @@ public class Tar extends MatchingTask { | |||||
Vector fileSetFiles = new Vector(); | Vector fileSetFiles = new Vector(); | ||||
// CheckStyle:VisibilityModifier ON | |||||
/** | /** | ||||
* Indicates whether the user has been warned about long files already. | * Indicates whether the user has been warned about long files already. | ||||
*/ | */ | ||||
@@ -668,6 +671,7 @@ public class Tar extends MatchingTask { | |||||
/** | /** | ||||
* whether the given resource collection is a (subclass of) | * whether the given resource collection is a (subclass of) | ||||
* FileSet that only contains file system resources. | * FileSet that only contains file system resources. | ||||
* @param rc the resource collection to check. | |||||
* @return true if the collection is a fileset. | * @return true if the collection is a fileset. | ||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
@@ -678,6 +682,7 @@ public class Tar extends MatchingTask { | |||||
/** | /** | ||||
* Grabs all included files and directors from the FileSet and | * Grabs all included files and directors from the FileSet and | ||||
* returns them as an array of (relative) file names. | * returns them as an array of (relative) file names. | ||||
* @param fs the fileset to operate on. | |||||
* @return a list of the filenames. | * @return a list of the filenames. | ||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
@@ -33,10 +33,11 @@ import org.apache.tools.ant.types.resources.FileResource; | |||||
*/ | */ | ||||
public abstract class Unpack extends Task { | public abstract class Unpack extends Task { | ||||
// CheckStyle:VisibilityModifier OFF - bc | |||||
protected File source; | protected File source; | ||||
protected File dest; | protected File dest; | ||||
protected Resource srcResource; | protected Resource srcResource; | ||||
// CheckStyle:VisibilityModifier ON | |||||
/** | /** | ||||
* @deprecated since 1.5.x. | * @deprecated since 1.5.x. | ||||
@@ -91,6 +91,7 @@ public class Untar extends Expand { | |||||
/** | /** | ||||
* @see Expand#expandFile(FileUtils, File, File) | * @see Expand#expandFile(FileUtils, File, File) | ||||
*/ | */ | ||||
/** {@inheritDoc} */ | |||||
protected void expandFile(FileUtils fileUtils, File srcF, File dir) { | protected void expandFile(FileUtils fileUtils, File srcF, File dir) { | ||||
FileInputStream fis = null; | FileInputStream fis = null; | ||||
try { | try { | ||||
@@ -53,7 +53,9 @@ public class UpToDate extends Task implements Condition { | |||||
private Vector sourceFileSets = new Vector(); | private Vector sourceFileSets = new Vector(); | ||||
private Union sourceResources = new Union(); | private Union sourceResources = new Union(); | ||||
// CheckStyle:VisibilityModifier OFF - bc | |||||
protected Mapper mapperElement = null; | protected Mapper mapperElement = null; | ||||
// CheckStyle:VisibilityModifier ON | |||||
/** | /** | ||||
* The property to set if the target file is more up-to-date than | * The property to set if the target file is more up-to-date than | ||||
@@ -55,6 +55,7 @@ public class VerifyJar extends AbstractJarSignerTask { | |||||
*/ | */ | ||||
private boolean certificates = false; | private boolean certificates = false; | ||||
private BufferingOutputFilter outputCache = new BufferingOutputFilter(); | private BufferingOutputFilter outputCache = new BufferingOutputFilter(); | ||||
/** Error output if there is a failure to verify the jar. */ | |||||
public static final String ERROR_NO_VERIFY = "Failed to verify "; | public static final String ERROR_NO_VERIFY = "Failed to verify "; | ||||
/** | /** | ||||
@@ -179,11 +179,17 @@ public class WaitFor extends ConditionBase { | |||||
*/ | */ | ||||
public static class Unit extends EnumeratedAttribute { | public static class Unit extends EnumeratedAttribute { | ||||
/** millisecond string */ | |||||
public static final String MILLISECOND = "millisecond"; | public static final String MILLISECOND = "millisecond"; | ||||
/** second string */ | |||||
public static final String SECOND = "second"; | public static final String SECOND = "second"; | ||||
/** minute string */ | |||||
public static final String MINUTE = "minute"; | public static final String MINUTE = "minute"; | ||||
/** hour string */ | |||||
public static final String HOUR = "hour"; | public static final String HOUR = "hour"; | ||||
/** day string */ | |||||
public static final String DAY = "day"; | public static final String DAY = "day"; | ||||
/** week string */ | |||||
public static final String WEEK = "week"; | public static final String WEEK = "week"; | ||||
private static final String[] UNITS = { | private static final String[] UNITS = { | ||||
@@ -215,6 +221,7 @@ public class WaitFor extends ConditionBase { | |||||
/** | /** | ||||
* @see EnumeratedAttribute#getValues() | * @see EnumeratedAttribute#getValues() | ||||
*/ | */ | ||||
/** {@inheritDoc} */ | |||||
public String[] getValues() { | public String[] getValues() { | ||||
return UNITS; | return UNITS; | ||||
} | } | ||||
@@ -216,7 +216,10 @@ public class War extends Jar { | |||||
* gets executed. | * gets executed. | ||||
*/ | */ | ||||
protected void cleanUp() { | protected void cleanUp() { | ||||
if (addedWebXmlFile == null && deploymentDescriptor==null && needxmlfile && !isInUpdateMode()) { | |||||
if (addedWebXmlFile == null | |||||
&& deploymentDescriptor == null | |||||
&& needxmlfile | |||||
&& !isInUpdateMode()) { | |||||
throw new BuildException("No WEB-INF/web.xml file was added.\n" | throw new BuildException("No WEB-INF/web.xml file was added.\n" | ||||
+ "If this is your intent, set needxml='false' "); | + "If this is your intent, set needxml='false' "); | ||||
} | } | ||||
@@ -69,7 +69,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
private String fileNameParameter = null; | private String fileNameParameter = null; | ||||
/** name for XSL parameter containing the file directory */ | /** name for XSL parameter containing the file directory */ | ||||
public String fileDirParameter = null; | |||||
private String fileDirParameter = null; | |||||
/** additional parameters to be passed to the stylesheets */ | /** additional parameters to be passed to the stylesheets */ | ||||
private Vector params = new Vector(); | private Vector params = new Vector(); | ||||
@@ -1658,6 +1658,7 @@ public class Zip extends MatchingTask { | |||||
/** | /** | ||||
* @see EnumeratedAttribute#getValues() | * @see EnumeratedAttribute#getValues() | ||||
*/ | */ | ||||
/** {@inheritDoc} */ | |||||
public String[] getValues() { | public String[] getValues() { | ||||
return new String[] {"add", "preserve", "fail"}; | return new String[] {"add", "preserve", "fail"}; | ||||
} | } | ||||
@@ -42,23 +42,35 @@ import org.apache.tools.ant.util.FileUtils; | |||||
* It produces an XML output representing the list of changes. | * It produces an XML output representing the list of changes. | ||||
* <pre> | * <pre> | ||||
* <font color=#0000ff><!-- Root element --></font> | * <font color=#0000ff><!-- Root element --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> changelog <font color=#ff00ff>(entry</font><font color=#ff00ff>+</font><font color=#ff00ff>)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> changelog <font color=#ff00ff> | |||||
* (entry</font><font color=#ff00ff>+</font><font color=#ff00ff>) | |||||
* </font><font color=#6a5acd>></font> | |||||
* <font color=#0000ff><!-- CVS Entry --></font> | * <font color=#0000ff><!-- CVS Entry --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> entry <font color=#ff00ff>(date,author,file</font><font color=#ff00ff>+</font><font color=#ff00ff>,msg)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> entry <font color=#ff00ff> | |||||
* (date,author,file</font><font color=#ff00ff>+</font><font color=#ff00ff>,msg) | |||||
* </font><font color=#6a5acd>></font> | |||||
* <font color=#0000ff><!-- Date of cvs entry --></font> | * <font color=#0000ff><!-- Date of cvs entry --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> date <font color=#ff00ff>(#PCDATA)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> date <font color=#ff00ff>(#PCDATA) | |||||
* </font><font color=#6a5acd>></font> | |||||
* <font color=#0000ff><!-- Author of change --></font> | * <font color=#0000ff><!-- Author of change --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> author <font color=#ff00ff>(#PCDATA)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> author <font color=#ff00ff>(#PCDATA) | |||||
* </font><font color=#6a5acd>></font> | |||||
* <font color=#0000ff><!-- List of files affected --></font> | * <font color=#0000ff><!-- List of files affected --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> msg <font color=#ff00ff>(#PCDATA)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> msg <font color=#ff00ff>(#PCDATA) | |||||
* </font><font color=#6a5acd>></font> | |||||
* <font color=#0000ff><!-- File changed --></font> | * <font color=#0000ff><!-- File changed --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> file <font color=#ff00ff>(name,revision,prevrevision</font><font color=#ff00ff>?</font><font color=#ff00ff>)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> file <font color=#ff00ff> | |||||
* (name,revision,prevrevision</font><font color=#ff00ff>?</font> | |||||
* <font color=#ff00ff>)</font><font color=#6a5acd>></font> | |||||
* <font color=#0000ff><!-- Name of the file --></font> | * <font color=#0000ff><!-- Name of the file --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> name <font color=#ff00ff>(#PCDATA)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> name <font color=#ff00ff>(#PCDATA) | |||||
* </font><font color=#6a5acd>></font> | |||||
* <font color=#0000ff><!-- Revision number --></font> | * <font color=#0000ff><!-- Revision number --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> revision <font color=#ff00ff>(#PCDATA)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> revision <font color=#ff00ff> | |||||
* (#PCDATA)</font><font color=#6a5acd>></font> | |||||
* <font color=#0000ff><!-- Previous revision number --></font> | * <font color=#0000ff><!-- Previous revision number --></font> | ||||
* <font color=#6a5acd><!ELEMENT</font> prevrevision <font color=#ff00ff>(#PCDATA)</font><font color=#6a5acd>></font> | |||||
* <font color=#6a5acd><!ELEMENT</font> prevrevision <font color=#ff00ff> | |||||
* (#PCDATA)</font><font color=#6a5acd>></font> | |||||
* </pre> | * </pre> | ||||
* | * | ||||
* @since Ant 1.5 | * @since Ant 1.5 | ||||
@@ -98,7 +98,7 @@ public class EmailTask extends Task { | |||||
/** Password for SMTP auth */ | /** Password for SMTP auth */ | ||||
private String password = null; | private String password = null; | ||||
/** indicate if the user wishes SSL-TLS */ | /** indicate if the user wishes SSL-TLS */ | ||||
private boolean SSL = false; | |||||
private boolean ssl = false; | |||||
/** | /** | ||||
* Set the user for SMTP auth; this requires JavaMail. | * Set the user for SMTP auth; this requires JavaMail. | ||||
@@ -120,11 +120,11 @@ public class EmailTask extends Task { | |||||
/** | /** | ||||
* Set whether to send data over SSL. | * Set whether to send data over SSL. | ||||
* @param SSL boolean; if true SSL will be used. | |||||
* @param ssl boolean; if true SSL will be used. | |||||
* @since Ant 1.6 | * @since Ant 1.6 | ||||
*/ | */ | ||||
public void setSSL(boolean SSL) { | |||||
this.SSL = SSL; | |||||
public void setSSL(boolean ssl) { | |||||
this.ssl = ssl; | |||||
} | } | ||||
/** | /** | ||||
@@ -360,7 +360,7 @@ public class EmailTask extends Task { | |||||
/** | /** | ||||
* Creates a Path as container for attachments. Supports any | * Creates a Path as container for attachments. Supports any | ||||
* filesystem resource-collections that way. | * filesystem resource-collections that way. | ||||
* | |||||
* @return the path to be configured. | |||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
public Path createAttachments() { | public Path createAttachments() { | ||||
@@ -432,7 +432,7 @@ public class EmailTask extends Task { | |||||
throw new BuildException("SMTP auth only possible with MIME mail"); | throw new BuildException("SMTP auth only possible with MIME mail"); | ||||
} | } | ||||
// SSL only allowed with MIME mail | // SSL only allowed with MIME mail | ||||
if (autoFound == false && (SSL) | |||||
if (!autoFound && (ssl) | |||||
&& (encoding.equals(UU) || encoding.equals(PLAIN))) { | && (encoding.equals(UU) || encoding.equals(PLAIN))) { | ||||
throw new BuildException("SSL only possible with MIME mail"); | throw new BuildException("SSL only possible with MIME mail"); | ||||
} | } | ||||
@@ -518,7 +518,7 @@ public class EmailTask extends Task { | |||||
mailer.setPort(port); | mailer.setPort(port); | ||||
mailer.setUser(user); | mailer.setUser(user); | ||||
mailer.setPassword(password); | mailer.setPassword(password); | ||||
mailer.setSSL(SSL); | |||||
mailer.setSSL(ssl); | |||||
mailer.setMessage(message); | mailer.setMessage(message); | ||||
mailer.setFrom(from); | mailer.setFrom(from); | ||||
mailer.setReplyToList(replyToList); | mailer.setReplyToList(replyToList); | ||||
@@ -559,6 +559,7 @@ public class EmailTask extends Task { | |||||
* Sets the character set of mail message. | * Sets the character set of mail message. | ||||
* Will be ignored if mimeType contains ....; Charset=... substring or | * Will be ignored if mimeType contains ....; Charset=... substring or | ||||
* encoding is not a <code>mime</code>. | * encoding is not a <code>mime</code>. | ||||
* @param charset the character encoding to use. | |||||
* @since Ant 1.6 | * @since Ant 1.6 | ||||
*/ | */ | ||||
public void setCharset(String charset) { | public void setCharset(String charset) { | ||||
@@ -58,6 +58,8 @@ import org.apache.tools.ant.BuildException; | |||||
* @since Ant 1.5 | * @since Ant 1.5 | ||||
*/ | */ | ||||
public class MimeMailer extends Mailer { | public class MimeMailer extends Mailer { | ||||
private final static String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; | |||||
/** Default character set */ | /** Default character set */ | ||||
private static final String DEFAULT_CHARSET | private static final String DEFAULT_CHARSET | ||||
= System.getProperty("file.encoding"); | = System.getProperty("file.encoding"); | ||||
@@ -145,7 +147,6 @@ public class MimeMailer extends Mailer { | |||||
+ "security provider, check that you have JSSE in " | + "security provider, check that you have JSSE in " | ||||
+ "your classpath"); | + "your classpath"); | ||||
} | } | ||||
final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; | |||||
// SMTP provider | // SMTP provider | ||||
props.put("mail.smtp.socketFactory.class", SSL_FACTORY); | props.put("mail.smtp.socketFactory.class", SSL_FACTORY); | ||||
props.put("mail.smtp.socketFactory.fallback", "false"); | props.put("mail.smtp.socketFactory.fallback", "false"); | ||||