Browse Source

Roll back check on size of file as it does not deal with

a prepend/append filter.
Just use the default size in ChainReaderHelper rather that
the filesize as the file could be very big.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275335 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
6f7a6bd817
1 changed files with 0 additions and 7 deletions
  1. +0
    -7
      src/main/org/apache/tools/ant/taskdefs/LoadProperties.java

+ 0
- 7
src/main/org/apache/tools/ant/taskdefs/LoadProperties.java View File

@@ -137,18 +137,12 @@ public final class LoadProperties extends Task {
throw new BuildException("Source file is not a file."); throw new BuildException("Source file is not a file.");
} }


// Check if the source file is empty
if (srcFile.length() == 0) {
return;
}
FileInputStream fis = null; FileInputStream fis = null;
BufferedInputStream bis = null; BufferedInputStream bis = null;
Reader instream = null; Reader instream = null;


try { try {
final long len = srcFile.length(); final long len = srcFile.length();
final int size = (int) len;


//open up the file //open up the file
fis = new FileInputStream(srcFile); fis = new FileInputStream(srcFile);
@@ -160,7 +154,6 @@ public final class LoadProperties extends Task {
} }


ChainReaderHelper crh = new ChainReaderHelper(); ChainReaderHelper crh = new ChainReaderHelper();
crh.setBufferSize(size);
crh.setPrimaryReader(instream); crh.setPrimaryReader(instream);
crh.setFilterChains(filterChains); crh.setFilterChains(filterChains);
crh.setProject(getProject()); crh.setProject(getProject());


Loading…
Cancel
Save