Package org.apache.ivyde.eclipse.cp

Examples of org.apache.ivyde.eclipse.cp.ResolvedPath


            throw e;
        }
    }

    private Ivy doGetIvy() throws IvyDEException {
        ResolvedPath settingsPath = getIvySettingsPath();
        if (settingsPath.getError() != null) {
            throw new IvyDEException("Incorrect path of the Ivy settings",
                    "The Ivy settings path '" + settingsPath.getInputPath() + "' is incorrect: "
                            + settingsPath.getError().getMessage(), settingsPath.getError());
        }
        if (!settingsPath.isSet()) {
            IvyDEMessage.debug("No settings specified, so take the default one");
            if (ivy == null) {
                IvySettings ivySettings = createIvySettings();
                ivy = Ivy.newInstance(ivySettings);
                try {
                    ivy.configureDefault();
                } catch (ParseException e) {
                    ivy = null;
                    IvyDEException ex = new IvyDEException(
                            "Parsing error of the default Ivy settings",
                            "The default Ivy settings file could not be parsed: " + e.getMessage(),
                            e);
                    throw ex;
                } catch (IOException e) {
                    ivy = null;
                    throw new IvyDEException("Read error of the default Ivy settings",
                            "The default Ivy settings file could not be read: " + e.getMessage(), e);
                }
            }
            return ivy;
        }

        // before returning the found ivy, try to refresh it if the settings changed
        if (settingsPath.getFile() != null) {
            return getIvyFromFile(settingsPath);
        } else {
            // an URL but not a file
            if (ivy == null || ivySettingsLastModified == -1) {
                IvySettings ivySettings = createIvySettings();
                ivy = Ivy.newInstance(ivySettings);
                try {
                    ivy.configure(settingsPath.getUrl());
                    ivySettingsLastModified = 0;
                } catch (ParseException e) {
                    ivy = null;
                    throw new IvyDEException("Parsing error of the Ivy settings",
                            "The ivy settings file '" + settingsPath.getResolvedPath()
                                    + "' could not be parsed: " + e.getMessage(), e);
                } catch (IOException e) {
                    ivy = null;
                    throw new IvyDEException("Read error of the Ivy settings",
                            "The ivy settings file '" + settingsPath.getResolvedPath()
                                    + "' could not be read: " + e.getMessage(), e);
                }
            }
        }
        return ivy;
View Full Code Here


            IPath location = getProject().getLocation();
            if (location != null) {
                ivySettings.setBaseDir(location.toFile());
            }
        }
        ResolvedPath ivyUserDir = getIvyUserDir();
        if (ivyUserDir.getError() != null) {
            throw new IvyDEException("Incorrect path of the Ivy user dir",
                    "The Ivy user dir '" + ivyUserDir.getInputPath() + "' is incorrect: "
                            + ivyUserDir.getError().getMessage(), ivyUserDir.getError());
        }
        if (ivyUserDir.isSet()) {
            ivySettings.setDefaultIvyUserDir(ivyUserDir.getFile());
        }
        Collection propFiles = getPropertyFiles();
        if (propFiles == null || propFiles.isEmpty()) {
            IvyDEMessage.verbose("No property files to load");
        } else {
View Full Code Here

        }
        return ivySettings;
    }

    public File getIvyFile() throws IvyDEException {
        ResolvedPath ivyPath = new ResolvedPath(getIvyXmlPath(), getProject());
        if (ivyPath.getError() != null) {
            throw new IvyDEException("Incorrect path of the ivy.xml",
                    "The ivy.xml path '" + ivyPath.getInputPath() + "' is incorrect: "
                            + ivyPath.getError().getMessage(), ivyPath.getError());
        }
        if (!ivyPath.isSet()) {
            throw new IvyDEException("Empty path of the ivy.xml",
                    "The ivy.xml path is resolved to be empty: '" + ivyPath.getInputPath() + "'",
                    null);
        }
        if (ivyPath.getFile() == null) {
            throw new IvyDEException("The path of the ivy.xml is not a local file",
                    "The ivy.xml path is resolved to be a file: '" + ivyPath.getResolvedPath()
                            + "'", null);
        }
        return ivyPath.getFile();
    }
View Full Code Here

TOP

Related Classes of org.apache.ivyde.eclipse.cp.ResolvedPath

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.