Package org.exist.backup

Examples of org.exist.backup.Restore


        final Callable<Void> callable = new Callable<Void>() {

            @Override
            public Void call() throws Exception {

                final Restore restore = new Restore();
               
                try {
                    restore.restore(listener, username, password, dbaPassword, f, uri);

                    if (JOptionPane.showConfirmDialog(null, Messages.getString("ClientFrame.223"), Messages.getString("ClientFrame.224"),
                            JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                        setStatus(Messages.getString("ClientFrame.225"));
                        repairRepository(client.getCollection());
View Full Code Here


                            throw( new BuildException( msg ) );
                        } else {
                            log( msg, Project.MSG_ERR );
                        }
                    } else {
                        final Restore         restore  = new Restore();
                        final RestoreListener listener = new DefaultRestoreListener();
                        restore.restore( listener, user, password, restorePassword, file, uri );
                    }

                } else if( dirSet != null ) {
                    final DirectoryScanner scanner = dirSet.getDirectoryScanner( getProject() );
                    scanner.scan();
                    final String[] includedFiles = scanner.getIncludedFiles();
                    log( "Found " + includedFiles.length + " files.\n" );

                    for( final String included : includedFiles ) {
                        dir = new File( scanner.getBasedir() + File.separator + included );
                        final File contentsFile = new File( dir, "__contents__.xml" );

                        if( !contentsFile.exists() ) {
                            final String msg = "Did not found file " + contentsFile.getAbsolutePath();

                            if( failonerror ) {
                                throw( new BuildException( msg ) );
                            } else {
                                log( msg, Project.MSG_ERR );
                            }
                        } else {
                            log( "Restoring from " + contentsFile.getAbsolutePath() + " ...\n" );

                            // TODO subdirectories as sub-collections?
                            final Restore         restore  = new Restore();
                            final RestoreListener listener = new DefaultRestoreListener();
                            restore.restore( listener, user, password, restorePassword, contentsFile, uri );
                        }
                    }

                } else if( zipFile != null ) {
                    log( "Restoring from " + zipFile.getAbsolutePath(), Project.MSG_INFO );

                    if( !zipFile.exists() ) {
                        final String msg = "File not found: " + zipFile.getAbsolutePath();

                        if( failonerror ) {
                            throw( new BuildException( msg ) );
                        } else {
                            log( msg, Project.MSG_ERR );
                        }
                    } else {
                        final Restore         restore  = new Restore();
                        final RestoreListener listener = new DefaultRestoreListener();
                        restore.restore( listener, user, password, restorePassword, zipFile, uri );
                    }
                }

            }
            catch( final Exception e ) {
View Full Code Here

TOP

Related Classes of org.exist.backup.Restore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.