* @param project
* @return the configured global easyant-ivysettings.file
* @throws MalformedURLException
*/
private URL getGlobalEasyAntIvySettings(Project project) throws MalformedURLException {
PropertyHelper helper = PropertyHelper.getPropertyHelper(project);
URL path = null;
if (configuration.getEasyantIvySettingsFile() != null) {
File f = new File(helper.replaceProperties(configuration.getEasyantIvySettingsFile()));
path = f.toURI().toURL();
}
if (configuration.getEasyantIvySettingsUrl() != null) {
path = new URL(helper.replaceProperties(configuration.getEasyantIvySettingsUrl()));
}
// path can be specified through a property
if (path == null && project.getProperty(EasyAntMagicNames.GLOBAL_EASYANT_IVYSETTINGS) != null) {
path = new URL(project.getProperty(EasyAntMagicNames.GLOBAL_EASYANT_IVYSETTINGS));
}
// if no property is set check the default location
if (path == null) {
File defaultGlboalEasyAntIvySettings = new File(
helper.replaceProperties(EasyAntConstants.DEFAULT_GLOBAL_EASYANT_IVYSETTINGS));
if (!defaultGlboalEasyAntIvySettings.exists()) {
return null;
}
path = defaultGlboalEasyAntIvySettings.toURI().toURL();
}