public void restore(BackupMetaData backup, File destinationFile) throws Exception
    {
        File tempFile = File.createTempFile("exhibitor-backup", ".tmp");
        OutputStream out = new FileOutputStream(tempFile);
        InputStream in = null;
        try {
            backupProvider.get().downloadBackup(exhibitor, backup, out, getBackupConfig());
            CloseableUtils.closeQuietly(out);
            out = null;

            out = new FileOutputStream(destinationFile);
            in = new GZIPInputStream(new FileInputStream(tempFile));

            ByteStreams.copy(in, out);
        }
        finally {
            CloseableUtils.closeQuietly(in);
            CloseableUtils.closeQuietly(out);
            if (!tempFile.delete()) {
                exhibitor.getLog().add(ActivityLog.Type.ERROR, "Could not delete temp file (for restore): " + tempFile);
            }
        }
    }
public void restore ( BackupMetaData backup , File destinationFile ) throws Exception { File tempFile = File . createTempFile ( "exhibitor-backup" , ".tmp" ) ; OutputStream out = new FileOutputStream ( tempFile ) ; InputStream in = null ; try { backupProvider . get ( ) . downloadBackup ( exhibitor , backup , out , getBackupConfig ( ) ) ; CloseableUtils . closeQuietly ( out ) ; out = null ; out = new FileOutputStream ( destinationFile ) ; in = new GZIPInputStream ( new FileInputStream ( tempFile ) ) ; ByteStreams . copy ( in , out ) ; } finally { CloseableUtils . closeQuietly ( in ) ; CloseableUtils . closeQuietly ( out ) ; if ( ! tempFile . delete ( ) ) { exhibitor . getLog ( ) . add ( ActivityLog . Type . ERROR , "Could not delete temp file (for restore): " + tempFile ) ; } } }
Restore the given key to the given file

@param backup          the backup to pull down
@param destinationFile the file
@throws Exception errors