private static void restoreDatabase(Properties properties) throws IOException, TarMalformatException {
  String backup=properties.getProperty("dhus.db.backup");
  String location=properties.getProperty("dhus.db.location");
  if (backup == null || location == null) {
    throw new UnsupportedOperationException();
  }
  FileUtils.deleteDirectory(new File(location));
  String[] args={"--extract",backup,location};
  DbBackupMain.main(args);
  logger.info("Database restored.");
}

private static void restoreDatabase ( Properties properties ) throws IOException , TarMalformatException { String backup = properties . getProperty ( "dhus.db.backup" ) ; String location = properties . getProperty ( "dhus.db.location" ) ; if ( backup == null || location == null ) { throw new UnsupportedOperationException ( ) ; } FileUtils . deleteDirectory ( new File ( location ) ) ; String [ ] args = { "--extract" , backup , location } ; DbBackupMain . main ( args ) ; logger . info ( "Database restored." ) ; }
performs database restoration . no need of transaction here : dbmain is called before starting datasource .
