TraversableSource inputSource = null;
try {
inputSource = (TraversableSource) this.resolver.resolveURI(this.source);
if (!inputSource.isCollection()) {
throw new ResourceNotFoundException(this.source + " is not a collection.");
}
this.contentHandler.startDocument();
Stack ancestors = getAncestors(inputSource);
addAncestorPath(inputSource, ancestors);
this.contentHandler.endDocument();
if (this.validity != null) {
this.validity.close();
}
} catch (SourceException se) {
throw SourceUtil.handle(se);
} catch (IOException ioe) {
throw new ResourceNotFoundException("Could not read collection "
+ this.source, ioe);
} catch (ClassCastException ce) {
throw new ResourceNotFoundException(this.source
+ " is not a traversable source");
} finally {
this.resolver.release(inputSource);
}
}