File tree Expand file tree Collapse file tree
src/main/java/de/rwth/idsg/steve/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package de .rwth .idsg .steve .utils ;
22
3+ import com .google .common .base .Splitter ;
34import com .google .common .base .Strings ;
45import lombok .extern .slf4j .Slf4j ;
56
67import java .io .FileInputStream ;
78import java .io .FileNotFoundException ;
89import java .io .IOException ;
910import java .io .InputStream ;
11+ import java .util .Collections ;
12+ import java .util .List ;
1013import java .util .Properties ;
1114
1215/**
@@ -76,6 +79,18 @@ public String getOptionalString(String key) {
7679 return trim (key , s );
7780 }
7881
82+ public List <String > getStringList (String key ) {
83+ String s = prop .getProperty (key );
84+ if (Strings .isNullOrEmpty (s )) {
85+ return Collections .emptyList ();
86+ }
87+
88+ return Splitter .on ("," )
89+ .trimResults ()
90+ .omitEmptyStrings ()
91+ .splitToList (s );
92+ }
93+
7994 public Boolean getOptionalBoolean (String key ) {
8095 String s = getOptionalString (key );
8196 if (s == null ) {
You can’t perform that action at this time.
0 commit comments