Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Feb 29, 2012
1 parent c7d8ee1 commit 9fa3650
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/org/jenkinsci/plugins/envinject/EnvInjectInfo.java
Expand Up @@ -2,6 +2,7 @@

import hudson.Util;
import org.jenkinsci.lib.envinject.EnvInjectException;
import org.jenkinsci.plugins.envinject.service.PropertiesGetter;
import org.jenkinsci.plugins.envinject.service.PropertiesLoader;
import org.kohsuke.stapler.DataBoundConstructor;

Expand Down Expand Up @@ -33,15 +34,21 @@ public String getPropertiesFilePath() {
return propertiesFilePath;
}

@SuppressWarnings("unused")
@SuppressWarnings({"unused", "deprecation"})
public String getPropertiesContent() {

if (propertiesContentMap != null && propertiesContentMap.size() != 0) {
PropertiesGetter propertiesGetter = new PropertiesGetter();
return propertiesGetter.getPropertiesContent(propertiesContentMap);
}

return propertiesContent;
}

@SuppressWarnings("deprecation")
public Map<String, String> getPropertiesContentMap() {

if (propertiesContentMap != null) {
if (propertiesContentMap != null && propertiesContentMap.size() != 0) {
return propertiesContentMap;
}

Expand Down
Expand Up @@ -9,6 +9,11 @@
public class PropertiesGetter implements Serializable {

public String getPropertiesContent(Map<String, String> propertiesContent) {

if (propertiesContent == null) {
return null;
}

StringBuffer sb = new StringBuffer();
for (Map.Entry<String, String> entry : propertiesContent.entrySet()) {
sb.append(entry.getKey() + "=" + entry.getValue() + "\n");
Expand Down

0 comments on commit 9fa3650

Please sign in to comment.