Author: kevj
Date: Tue Jul 4 20:15:22 2006
New Revision: 419143
URL: http://svn.apache.org/viewvc?rev=419143&view=rev
Log:
move validation of properties into private method
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java?rev=419143&r1=419142&r2=419143&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java Tue Jul
4 20:15:22 2006
@@ -275,7 +275,29 @@
*/
public void execute() throws BuildException {
// first off, make sure that we've got a srcdir and destdir
+ validate();
+
+ // log options used
+ String enc = encoding == null ? "default" : encoding;
+ log("options:"
+ + " eol=" + filter.getEol().getValue()
+ + " tab=" + filter.getTab().getValue()
+ + " eof=" + filter.getEof().getValue()
+ + " tablength=" + filter.getTablength()
+ + " encoding=" + enc
+ + " outputencoding="
+ + (outputEncoding == null ? enc : outputEncoding),
+ Project.MSG_VERBOSE);
+
+ DirectoryScanner ds = super.getDirectoryScanner(srcDir);
+ String[] files = ds.getIncludedFiles();
+
+ for (int i = 0; i < files.length; i++) {
+ processFile(files[i]);
+ }
+ }
+ private void validate() throws BuildException {
if (file != null) {
if (srcDir != null) {
throw new BuildException(ERROR_FILE_AND_SRCDIR);
@@ -302,26 +324,8 @@
throw new BuildException("destdir is not a directory!");
}
}
- // log options used
- String enc = encoding == null ? "default" : encoding;
- log("options:"
- + " eol=" + filter.getEol().getValue()
- + " tab=" + filter.getTab().getValue()
- + " eof=" + filter.getEof().getValue()
- + " tablength=" + filter.getTablength()
- + " encoding=" + enc
- + " outputencoding="
- + (outputEncoding == null ? enc : outputEncoding),
- Project.MSG_VERBOSE);
-
- DirectoryScanner ds = super.getDirectoryScanner(srcDir);
- String[] files = ds.getIncludedFiles();
-
- for (int i = 0; i < files.length; i++) {
- processFile(files[i]);
- }
}
-
+
private void processFile(String file) throws BuildException {
File srcFile = new File(srcDir, file);
long lastModified = srcFile.lastModified();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]