@@ -26,6 +26,7 @@ public class JsonConfig {
26
26
private static final String PROP_SYNC_MODE = "sync_mode" ;
27
27
private static final String PROP_PORT = "port" ;
28
28
private static final String PROP_ADDRESS = "address" ;
29
+ private static final String PROP_BUFFER_SIZE = "buffer" ;
29
30
private static final String PROP_DIRECTORIES = "directories" ;
30
31
private static final String PROP_FILES = "files" ;
31
32
private static final String PROP_FILES_INCLUDE = "include" ;
@@ -52,6 +53,13 @@ public static void forServer(Path json) throws IOException {
52
53
config .SYNC_MODE = getInt (general , PROP_SYNC_MODE );
53
54
config .SERVER_PORT = getInt (connection , PROP_PORT );
54
55
56
+ try {
57
+ config .BUFFER_SIZE = getInt (connection , PROP_BUFFER_SIZE );
58
+ } catch (NullPointerException e ) {
59
+ Logger .debug ("Missing config entry for buffer, using defaults" );
60
+ hasMissingEntries = true ;
61
+ }
62
+
55
63
try {
56
64
JsonArray directoryIncludeList = getArray (rules , PROP_DIRECTORIES );
57
65
config .DIRECTORY_INCLUDE_LIST = directoryIncludeList
@@ -136,6 +144,13 @@ public static void forClient(Path json) throws IOException {
136
144
config .SERVER_IP = getString (connection , PROP_ADDRESS , "127.0.0.1" );
137
145
config .SERVER_PORT = getInt (connection , PROP_PORT );
138
146
147
+ try {
148
+ config .BUFFER_SIZE = getInt (connection , PROP_BUFFER_SIZE );
149
+ } catch (NullPointerException e ) {
150
+ Logger .debug ("Missing config entry for buffer, using defaults" );
151
+ hasMissingEntries = true ;
152
+ }
153
+
139
154
try {
140
155
JsonObject files = getObject (rules , PROP_FILES );
141
156
config .FILE_IGNORE_LIST = getArray (files , PROP_FILES_IGNORE )
@@ -178,6 +193,7 @@ public static void saveServer(Path file) throws IOException {
178
193
179
194
JsonObject connection = new JsonObject ();
180
195
connection .add (PROP_PORT , config .SERVER_PORT );
196
+ connection .add (PROP_BUFFER_SIZE , config .BUFFER_SIZE );
181
197
root .add (CAT_CONNECTION , connection );
182
198
183
199
JsonObject rules = new JsonObject ();
@@ -216,6 +232,7 @@ public static void saveClient(Path file) throws IOException {
216
232
JsonObject connection = new JsonObject ();
217
233
connection .add (PROP_ADDRESS , config .SERVER_IP );
218
234
connection .add (PROP_PORT , config .SERVER_PORT );
235
+ connection .add (PROP_BUFFER_SIZE , config .BUFFER_SIZE );
219
236
root .add (CAT_CONNECTION , connection );
220
237
221
238
JsonObject rules = new JsonObject ();
0 commit comments