public boolean performFinish()

in eclipse/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/ImportWizard.java [68:127]


	public boolean performFinish() {

        if (!mainPage.isPageComplete()) {
            return false;
        }

        final IServer server = mainPage.getServer();

        IResource resource = mainPage.getResource();
        final IProject project = resource.getProject();
        final IPath projectRelativePath = resource.getProjectRelativePath();

        try {
            getContainer().run(true, true, new IRunnableWithProgress() {

                @Override
                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    // wrap the import action in a IWorkspaceRunnable to make sure that changes are only
                    // published once at the end. This is especially important since the import action
                    // sets persistent properties on the modified resources to avoid them being published
                    // following this change ( see org.apache.sling.ide.core.ResourceUtil )
                    try {
                        ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {

                            @Override
                            public void run(IProgressMonitor monitor) throws CoreException {
                                try {
                                    new ImportRepositoryContentAction(server, projectRelativePath, project,
                                            serializationManager).run(monitor);
                                } catch (SerializationException e) {
                                    throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
                                            "Import failed", e));
                                } catch (InvocationTargetException e) {
                                    throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
                                            "Import failed", e.getCause()));
                                } catch (InterruptedException e) {
                                    Thread.currentThread().interrupt();
                                } finally {
                                    serializationManager.destroy();
                                }
                            }
                        }, project, IWorkspace.AVOID_UPDATE, monitor);
                    } catch (CoreException e) {
                        throw new InvocationTargetException(e);
                    }
                }
            });
        } catch (InvocationTargetException e) {
            Throwable cause = e.getCause();
            mainPage.setErrorMessage("Import error : " + cause.getMessage()
                    + " . Please see the error log for details.");
            Activator.getDefault().getPluginLogger().error("Repository import failed", cause);
            return false;
        } catch (OperationCanceledException | InterruptedException e) {
            Thread.currentThread().interrupt();
            return false;
        }

        return true;
	}