1111
1212public class JarSettingsProperties {
1313
14+ static final String DEFAULT_JVM = "default" ;
15+ static final String DEFAULT_STACKSIZE = "1024k" ;
16+ static final boolean DEFAULT_FORCEIP4 = false ;
17+
18+ private String jvm ;
19+ private String stacksize ;
20+ private boolean forceipv4 ;
21+
1422 private String homedir = new File ("home" ).getAbsolutePath ();
1523
1624 private String address = "localhost" ;
@@ -44,6 +52,9 @@ public static JarSettingsProperties readFromFile(Path path) {
4452 try (InputStream inputStream = Files .newInputStream (path )) {
4553 properties .load (inputStream );
4654 }
55+ jarSettingsProperties .setJvm (properties .getProperty ("jvm" , DEFAULT_JVM ));
56+ jarSettingsProperties .setStacksize (properties .getProperty ("stacksize" ,DEFAULT_STACKSIZE ));
57+ jarSettingsProperties .setForceipv4 (Boolean .parseBoolean (properties .getProperty ("forceip4" , String .valueOf (DEFAULT_FORCEIP4 ))));
4758 jarSettingsProperties .setHomedir (properties .getProperty ("homedir" ));
4859 jarSettingsProperties .setAddress (properties .getProperty ("address" ));
4960 jarSettingsProperties .setUseProxy (Boolean .parseBoolean (properties .getProperty ("useProxy" )));
@@ -61,6 +72,9 @@ public static JarSettingsProperties readFromFile(Path path) {
6172 public void save () {
6273 Properties properties = new Properties ();
6374
75+ properties .setProperty ("jvm" , getJvm ());
76+ properties .setProperty ("stacksize" , getStacksize ());
77+ properties .setProperty ("forceipv4" , String .valueOf (isForceipv4 ()));
6478 properties .setProperty ("homedir" , getHomedir ());
6579 properties .setProperty ("address" , getAddress ());
6680 properties .setProperty ("useProxy" , String .valueOf (isUseProxy ()));
@@ -76,6 +90,18 @@ public void save() {
7690 }
7791 }
7892
93+ public String getJvm () { return jvm ; }
94+
95+ public void setJvm (String jvm ) { this .jvm = jvm ; }
96+
97+ public String getStacksize () { return stacksize ; }
98+
99+ public void setStacksize (String stacksize ) { this .stacksize = stacksize ; }
100+
101+ public boolean isForceipv4 () { return forceipv4 ; }
102+
103+ public void setForceipv4 (boolean forceipv4 ) { this .forceipv4 = forceipv4 ; }
104+
79105 public String getHomedir () {
80106 return homedir ;
81107 }
0 commit comments