Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Jul 2, 2012
1 parent e8105b8 commit 2be7887
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -39,6 +39,7 @@ public Map<String, String> getVarsFromPropertiesFile(File propertiesFile, Map<St
try {
String fileContent = Util.loadFile(propertiesFile);
String fileContentResolved = Util.replaceMacro(fileContent, currentEnvVars);
fileContentResolved = processPath(fileContentResolved);
properties.load(new StringReader(fileContentResolved));
} catch (IOException ioe) {
throw new EnvInjectException("Problem occurs on loading content", ioe);
Expand Down Expand Up @@ -66,6 +67,8 @@ public Map<String, String> getVarsFromPropertiesContent(String content) throws E
return null;
}

content = processPath(content);

Map<String, String> result = new LinkedHashMap<String, String>();
StringReader stringReader = new StringReader(content);
SortedProperties properties = new SortedProperties();
Expand All @@ -87,14 +90,17 @@ private String processProperty(Object prop) {
if (prop == null) {
return null;
}
return processPath(String.valueOf(prop).trim());

return String.valueOf(prop).trim();
}

private String processPath(String content) {
if (content == null) {
return null;
}
return content.replace("\\", "\\\\");

content = content.replace("\\", "\\\\");
return content.replace("\\\\\n", "\\\n");
}

}
Expand Down

0 comments on commit 2be7887

Please sign in to comment.