Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.CoreException


        Jar jar = new Jar(file);
        builder.setJar(jar);
        try {
            builder.analyze();
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Bnd analysis failed", e));
        }
        return builder;
    }
View Full Code Here


    }

    static Builder setupBuilderForBndFile(File file) throws IOException, CoreException {
        IFile[] wsfiles = FileUtils.getWorkspaceFiles(file);
        if (wsfiles == null || wsfiles.length == 0)
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Unable to determine project owner for Bnd file: " + file.getAbsolutePath(), null));

        IProject project = wsfiles[0].getProject();

        // Calculate the manifest
        try {
            Project bndProject = Central.getInstance().getModel(JavaCore.create(project));
            if (bndProject == null)
                return null;
            Builder builder;
            if (file.getName().equals(Project.BNDFILE)) {
                builder = bndProject.getSubBuilders().iterator().next();
            } else {
                builder = bndProject.getSubBuilder(file);
            }

            if (builder == null) {
                builder = new Builder();
                builder.setProperties(file);
            }
            builder.build();
            return builder;
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Bnd analysis failed", e));
        }
    }
View Full Code Here

            Collection<Project> projects = null;
            try {
                Workspace ws = Central.getWorkspace();
                projects = ws.getBuildOrder();
            } catch (Exception e) {
                throw new CoreException(new Status(IStatus.ERROR, NewBuilder.PLUGIN_ID, 0, "Error rebuilding bnd projects after creating workspace configuration.", e));
            }
            if (projects == null || projects.isEmpty())
                return Status.OK_STATUS;

            SubMonitor progress = SubMonitor.convert(monitor, projects.size());
View Full Code Here

            this.subBuilders = model.getSubBuilders();
            rebuildIfLocalChanges(dependsOn, false);

            return dependsOn;
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, 0, "Build Error!", e));
        } finally {
            listeners.release();
            if (!buildLog.isEmpty() && logLevel > 0) {
                StringBuilder builder = new StringBuilder();
                builder.append(String.format("BUILD LOG %2s %s", (nrFilesBuilt > 0 ? nrFilesBuilt : ""), getProject()));
View Full Code Here

            // Tell Eclipse what we did...
            IFolder targetFolder = myProject.getFolder(calculateTargetDirPath(model));
            targetFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, 0, "Build Error!", e));
        }
    }
View Full Code Here

        IFile dst = project.getFile(fullPath);

        try {
            return ResourceCopier.copy(url, dst, replaceRegularExpressions, monitor);
        } catch (IOException e) {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, e.getMessage(), e));
        }
    }
View Full Code Here

            this.subBuilders = model.getSubBuilders();
            rebuildIfLocalChanges(dependsOn, false);

            return dependsOn;
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, 0, "Build Error!", e));
        } finally {
            listeners.release();
            if (!buildLog.isEmpty() && logLevel > 0) {
                StringBuilder builder = new StringBuilder();
                builder.append(String.format("BUILD LOG for project %s (%d entries):", getProject(), buildLog.size()));
View Full Code Here

            // Tell Eclipse what we did...
            IFolder targetFolder = myProject.getFolder(calculateTargetDirPath(model));
            targetFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, 0, "Build Error!", e));
        }
    }
View Full Code Here

        recurseCreate(container.getParent(), progress.newChild(1, SubMonitor.SUPPRESS_NONE));

        if (container instanceof IFolder)
            ((IFolder) container).create(false, true, progress.newChild(1, SubMonitor.SUPPRESS_NONE));
        else
            throw new CoreException(new Status(IStatus.ERROR, BundleUtils.getBundleSymbolicName(FileUtils.class), 0, "Cannot create new projects or workspace roots automatically.", null));
    }
View Full Code Here

            file.setContents(inputStream, false, true, null);
        } else {
            if (createIfAbsent)
                file.create(inputStream, false, null);
            else
                throw new CoreException(new Status(IStatus.ERROR, BundleUtils.getBundleSymbolicName(FileUtils.class), 0, "File does not exist: " + file.getFullPath().toString(), null));
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.CoreException

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.