if (text != null) {
if (!text.endsWith("\n")) {
text = text + "\n";
}
final StringInputStream sis = new StringInputStream(text);
final Properties props = new Properties();
props.load(sis);
final Enumeration e = props.keys();
while (e.hasMoreElements()) {
final String key = (String) e.nextElement();
final String value = props.getProperty(key);
if (key != null && value != null
&& value.trim().length() > 0) {
project.setNewProperty(key, value);
}
}
sis.close();
}
} catch (final IOException ioe) {
final String message = "Unable to load file: " + ioe.toString();
throw new BuildException(message, ioe, location);