bool = Boolean.TRUE;
}
if ( bool != null && bool.booleanValue() ) {
boolean read = false;
SaxBuffer buffer = new SaxBuffer();
Exception error = null;
try {
if ( timeout != null ) {
final int milli = timeout.intValue() * 1000;
LoaderThread loader = new LoaderThread(this, coplet, buffer);
Thread thread = new Thread(loader);
thread.start();
try {
thread.join(milli);
} catch (InterruptedException ignore) {
}
if ( loader.finished ) {
read = true;
}
} else {
this.streamContent( coplet, buffer );
read = true;
}
} catch (Exception exception ) {
error = exception;
this.getLogger().warn("Unable to get content of coplet: " + coplet.getId(), exception);
}
if ( read ) {
buffer.toSAX( contentHandler );
} else {
if ( !this.renderErrorContent(coplet, contentHandler, error)) {
// FIXME - get correct error message
contentHandler.startDocument();
XMLUtils.startElement( contentHandler, "p");