} catch(final XMLDBException xe) {
throw new RuntimeException(xe.getMessage(), xe);
}
//parse the sub-collection descriptor and restore
final BackupDescriptor subDescriptor = descriptor.getChildBackupDescriptor(name);
if(subDescriptor != null) {
final SAXParser sax;
try {
sax = saxFactory.newSAXParser();
final XMLReader reader = sax.getXMLReader();
final EXistInputSource is = subDescriptor.getInputSource();
is.setEncoding( "UTF-8" );
final RestoreHandler handler = new RestoreHandler(listener, dbBaseUri, dbUsername, dbPassword, subDescriptor);
reader.setContentHandler(handler);
reader.parse(is);
} catch(final ParserConfigurationException pce) {
listener.error("Could not initalise SAXParser for processing sub-collection: " + descriptor.getSymbolicPath(name, false));
} catch(final IOException ioe) {
listener.error("Could not read sub-collection for processing: " + ioe.getMessage());
} catch(final SAXException se) {
listener.error("SAX exception while reading sub-collection " + subDescriptor.getSymbolicPath() + " for processing: " + se.getMessage());
}
} else {
listener.error("Collection " + descriptor.getSymbolicPath(name, false) + " does not exist or is not readable.");
}
}