value = aValue;
}
public void doExecute() throws BuildException {
Ivy ivy = getIvyInstance();
IvySettings settings = ivy.getSettings();
if (getName() != null) {
settings.setVariable(getVarName(getName()), getValue());
} else {
Properties props = new Properties();
InputStream is = null;
try {
if (getFile() != null) {
is = new FileInputStream(getFile());
} else if (getUrl() != null) {
is = new URL(getUrl()).openStream();
} else {
throw new BuildException("specify either name or file or url to ivy var task");
}
props.load(is);
} catch (Exception ex) {
throw new BuildException("impossible to load variables from file: " + ex, ex);
} finally {
if (is != null) {
try {
is.close();
} catch (Exception e) {
// ignore
}
}
}
for (Iterator iter = props.keySet().iterator(); iter.hasNext();) {
String name = (String) iter.next();
String value = (String) props.get(name);
settings.setVariable(getVarName(name), value);
}
}
}