Index: . =================================================================== --- . (revision 496688) +++ . (working copy) @@ -76,6 +76,12 @@ private File file = null; /** + * File to which all checksums will be written. If not specified, + * a separate file will be written for each checksum. + */ + private File tofile; + + /** * Root directory in which the checksum files will be written. * If not specified, the checksum files will be written * in the same directory as each file. @@ -160,6 +166,16 @@ } /** + * Sets a file to which checksums will be written. + * written/read + * @param tofile a File value + * @since Ant 1.7 + */ + public void setTofile(File tofile) { + this.tofile = tofile; + } + + /** * Sets the root directory where checksum files will be * written/read * @param todir the directory to write to @@ -383,6 +399,9 @@ } else if (fileext.trim().length() == 0) { throw new BuildException("File extension when specified must not be an empty string"); } + if (tofile != null && tofile.exists()) { + tofile.delete(); + } try { if (resources != null) { for (Iterator i = resources.iterator(); i.hasNext();) { @@ -445,7 +464,9 @@ } private File getChecksumFile(File file) { - File directory; + if (tofile != null) + return tofile; + File directory; if (todir != null) { // A separate directory was explicitly declared String path = (String) relativeFilePaths.get(file); @@ -526,7 +547,7 @@ } } else { File dest = (File) destination; - fos = new FileOutputStream(dest); + fos = new FileOutputStream(dest, tofile != null); fos.write(format.format(new Object[] { checksum, src.getName(),