if (!inFile.canRead()) {
getResponse().setStatus(Status.CLIENT_ERROR_EXPECTATION_FAILED);
return new StringRepresentation("Cannot read input file "+inFile.getAbsolutePath());
}
getContext().getLogger().info("Restoring database from "+inFile.getAbsolutePath());
DocumentLoader loader = new SAXDocumentLoader();
loader.generate(inFile.toURI(),new RestoreDestination(getContext().getLogger(),db));
getContext().getLogger().info("Restore finished.");
getResponse().setStatus(Status.SUCCESS_NO_CONTENT);
return null;
} catch (IOException ex) {
getContext().getLogger().log(Level.SEVERE,"Cannot get write data to output.",ex);