Methods Summary |
---|
public void | close()Close the stream.
closeCurrent();
eof = true;
|
private void | closeCurrent()
FileUtils.close(currentStream);
currentStream = null;
|
public boolean | isIgnoreErrors()Find out whether this ConcatResourceInputStream ignores errors.
return ignoreErrors;
|
public void | log(java.lang.String message, int loglevel)Log a message with the specified logging level.
if (managingPc != null) {
managingPc.log(message, loglevel);
} else {
(loglevel > Project.MSG_WARN ? System.out : System.err).println(message);
}
|
private void | nextResource()
closeCurrent();
while (iter.hasNext()) {
Resource r = (Resource) iter.next();
if (!r.isExists()) {
continue;
}
log("Concating " + r.toLongString(), Project.MSG_VERBOSE);
try {
currentStream = new BufferedInputStream(r.getInputStream());
return;
} catch (IOException eyeOhEx) {
if (!ignoreErrors) {
log("Failed to get input stream for " + r, Project.MSG_ERR);
throw eyeOhEx;
}
}
}
eof = true;
|
public int | read()Read a byte.
if (eof) {
return EOF;
}
int result = readCurrent();
if (result == EOF) {
nextResource();
result = readCurrent();
}
return result;
|
private int | readCurrent()
return eof || currentStream == null ? EOF : currentStream.read();
|
public void | setIgnoreErrors(boolean b)Set whether this ConcatResourceInputStream ignores errors.
ignoreErrors = b;
|
public void | setManagingComponent(org.apache.tools.ant.ProjectComponent pc)Set a managing ProjectComponent for
this ConcatResourceInputStream .
this.managingPc = pc;
|