Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Feb 13, 2012
1 parent 1df1729 commit b183fac
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -38,7 +38,7 @@ public Map<String, String> getVarsFromPropertiesFile(File propertiesFile, Map<St
SortedProperties properties = new SortedProperties();
try {
String fileContent = Util.loadFile(propertiesFile);
fileContent = processWindowsFilePath(fileContent);
fileContent = processFilePath(fileContent);
String fileContentResolved = Util.replaceMacro(fileContent, currentEnvVars);
properties.load(new StringReader(fileContentResolved));
} catch (IOException ioe) {
Expand All @@ -63,7 +63,7 @@ public Map<String, String> getVarsFromPropertiesContent(String content) throws E
throw new NullPointerException("The file content object must be set.");
}

content = processWindowsFilePath(content);
content = processFilePath(content);

Map<String, String> result = new LinkedHashMap<String, String>();
StringReader stringReader = new StringReader(content);
Expand All @@ -89,11 +89,10 @@ private String processProperty(Object prop) {
return String.valueOf(prop).trim();
}

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

Expand Down

0 comments on commit b183fac

Please sign in to comment.