ASF Bugzilla – Attachment 19413 Details for
Bug 41356
Output all checksums to single file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Simple patch that adds a "toFile" property to the "checksum" task
Checksum.java.patch (text/plain), 2.11 KB, created by
Eric Jain
on 2007-01-16 08:35:05 UTC
(
hide
)
Description:
Simple patch that adds a "toFile" property to the "checksum" task
Filename:
MIME Type:
Creator:
Eric Jain
Created:
2007-01-16 08:35:05 UTC
Size:
2.11 KB
patch
obsolete
>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 <code>File</code> 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(),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41356
: 19413