Examples of MultiStatus


Examples of org.apache.wink.webdav.model.Multistatus

        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
        Multistatus multistatus = new Multistatus();

        // fill the multistatus object with the response
        addResponseToMultistatus(multistatus, propfind, entry, handler);

        // HTTP response
View Full Code Here

Examples of org.apache.wink.webdav.model.Multistatus

        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
        Multistatus multistatus = new Multistatus();

        // root collection
        addResponseToMultistatus(multistatus, propfind, feed, provider);

        // sub-collections and entries
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

        this.model = model;
        this.callbacks = callbacks;
    }

    public void run(IProgressMonitor monitor) {
        MultiStatus status = new MultiStatus(Plugin.PLUGIN_ID, 0, Messages.ResolveOperation_errorOverview, null);

        // Start a coordination
        BundleContext bc = Plugin.getDefault().getBundleContext();
        ServiceReference coordSvcRef = bc.getServiceReference(Coordinator.class.getName());
        Coordinator coordinator = coordSvcRef != null ? (Coordinator) bc.getService(coordSvcRef) : null;
        Coordination coordination = coordinator != null ? coordinator.begin(ResolveOperation.class.getName(), 0) : null;

        // Begin resolve
        ResolveProcess resolve = new ResolveProcess();
        ResolverLogger logger = new ResolverLogger();
        try {
            ResolverImpl felixResolver = new ResolverImpl(logger);

            ReporterLogService log = new ReporterLogService(Central.getWorkspace());
            Map<Resource,List<Wire>> wirings = resolve.resolveRequired(model, Central.getWorkspace(), felixResolver, callbacks, log);
            result = new ResolutionResult(Outcome.Resolved, wirings, null, status, logger.getLog());
            if (coordination != null)
                coordination.end();
        } catch (ResolveCancelledException e) {
            result = new ResolutionResult(Outcome.Cancelled, null, null, status, logger.getLog());

            if (coordination != null)
                coordination.fail(e);
        } catch (ResolutionException e) {
            status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, e.getLocalizedMessage(), e));
            result = new ResolutionResult(Outcome.Unresolved, null, null, status, logger.getLog());

            if (coordination != null)
                coordination.fail(e);
        } catch (Exception e) {
            status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Exception during resolution.", e));
            result = new ResolutionResult(Outcome.Error, null, null, status, logger.getLog());

            if (coordination != null)
                coordination.fail(e);
        } finally {
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

    private static void generatePackageInfos(final Collection< ? extends File> pkgDirs) throws CoreException {
        final IWorkspaceRunnable wsOperation = new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
                SubMonitor progress = SubMonitor.convert(monitor, pkgDirs.size());
                MultiStatus status = new MultiStatus(Plugin.PLUGIN_ID, 0, "Errors occurred while creating packageinfo files.", null);
                for (File pkgDir : pkgDirs) {
                    IContainer[] locations = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(pkgDir.toURI());
                    if (locations != null && locations.length > 0) {
                        IFile pkgInfoFile = locations[0].getFile(new Path(PACKAGEINFO));

                        try {
                            ByteArrayInputStream input = new ByteArrayInputStream("version 1.0".getBytes("UTF-8"));
                            pkgInfoFile.create(input, false, progress.newChild(1, 0));
                        } catch (CoreException e) {
                            status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error creating file " + pkgInfoFile.getFullPath(), e));
                        } catch (UnsupportedEncodingException e) {
                            /* just ignore, should never happen */
                        }
                    }
                }

                if (!status.isOK())
                    throw new CoreException(status);
            }
        };
        IRunnableWithProgress uiOperation = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

            indirectResources = new HashSet<SearchableRepository.ResourceDescriptor>(depsPage.getIndirectResources());
            indirectResources.removeAll(result);
        } else {
            indirectResources = Collections.<ResourceDescriptor> emptySet();
        }
        final MultiStatus status = new MultiStatus(Plugin.PLUGIN_ID, 0, "Errors occurred while processing JPM4J dependencies.", null);
        IRunnableWithProgress runnable = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                SubMonitor progress = SubMonitor.convert(monitor, result.size() + indirectResources.size());
                progress.setTaskName("Processing dependencies...");

                // Process all resources (including non-selected ones) into the repository
                for (ResourceDescriptor resource : result)
                    processResource(resource, status, progress.newChild(1));
                for (ResourceDescriptor resource : indirectResources)
                    processResource(resource, status, progress.newChild(1));
            }
        };

        try {
            getContainer().run(true, true, runnable);

            if (!status.isOK())
                ErrorDialog.openError(getShell(), "Errors", null, status);

            return true;
        } catch (InvocationTargetException e) {
            MessageDialog.openError(getShell(), "Error", e.getCause().getMessage());
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

        logLevel = prefs.getBuildLogging();
        projectPrefs = new ScopedPreferenceStore(new ProjectScope(getProject()), BndtoolsConstants.CORE_PLUGIN_ID);

        // Prepare validations
        classpathErrors = new LinkedList<String>();
        validationResults = new MultiStatus(PLUGIN_ID, 0, "Validation errors in bnd project", null);
        buildLog = new ArrayList<String>(5);

        nrFilesBuilt = 0;

        try {
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

        addPage(fileSelectionPage);
    }

    @Override
    public boolean performFinish() {
        MultiStatus status = new MultiStatus(Plugin.PLUGIN_ID, 0, "Failed to install one or more bundles", null);

        List<File> files = fileSelectionPage.getFiles();
        selectedBundles = new LinkedList<Pair<String,String>>();
        for (File file : files) {
            Jar jar = null;
            try {
                jar = new Jar(file);
                jar.setDoNotTouchManifest();

                Attributes mainAttribs = jar.getManifest().getMainAttributes();
                String bsn = BundleUtils.getBundleSymbolicName(mainAttribs);
                String version = mainAttribs.getValue(Constants.BUNDLE_VERSION);
                if (version == null)
                    version = "0";
                selectedBundles.add(Pair.newInstance(bsn, version));
            } catch (Exception e) {
                status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, MessageFormat.format("Failed to analyse JAR: {0}", file.getPath()), e));
                continue;
            } finally {
                if (jar != null)
                    jar.close();
            }

            try {
                RepositoryPlugin.PutResult result = repository.put(new BufferedInputStream(new FileInputStream(file)), new RepositoryPlugin.PutOptions());
                if (result.artifact != null && result.artifact.getScheme().equals("file")) {
                    File newFile = new File(result.artifact);

                    RefreshFileJob refreshJob = new RefreshFileJob(newFile, false);
                    if (refreshJob.needsToSchedule())
                        refreshJob.schedule();
                }
            } catch (Exception e) {
                status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, MessageFormat.format("Failed to add JAR to repository: {0}", file.getPath()), e));
                continue;
            }

        }

        if (status.isOK()) {
            return true;
        }
        ErrorDialog.openError(getShell(), "Error", null, status);
        return false;
    }
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

        logLevel = prefs.getBuildLogging();
        projectPrefs = new ScopedPreferenceStore(new ProjectScope(getProject()), BndtoolsConstants.CORE_PLUGIN_ID);

        // Prepare validations
        classpathErrors = new LinkedList<String>();
        validationResults = new MultiStatus(PLUGIN_ID, 0, "Validation errors in bnd project", null);
        buildLog = new ArrayList<String>(5);

        try {
            // Prepare build listeners and build error handlers
            listeners = new BuildListeners();
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

            }

            if (!reports.isEmpty()) {
                IStatus[] reportsArray = new IStatus[reports.size()];
                reports.toArray(reportsArray);
                status = new MultiStatus(NewBuilder.PLUGIN_ID, 0, reportsArray, "Project paths mismatch" + (reports.size() > 1 ? "es" : ""), null);
            }
        } catch (Throwable e) {
            Logger.getLogger(this.getClass()).logError("Error during project paths validation", e);
        }
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

            }

            if (!reports.isEmpty()) {
                IStatus[] reportsArray = new IStatus[reports.size()];
                reports.toArray(reportsArray);
                status = new MultiStatus(NewBuilder.PLUGIN_ID, 0, reportsArray, "Project paths mismatch" + (reports.size() > 1 ? "es" : ""), null);
            }
        } catch (Throwable e) {
            Logger.getLogger(this.getClass()).logError("Error during java versions validation", e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.