1
1
package io .objectbox .sync ;
2
2
3
+ import javax .annotation .Nullable ;
4
+
3
5
import io .objectbox .BoxStore ;
4
6
import io .objectbox .annotation .apihint .Experimental ;
5
7
import io .objectbox .sync .internal .Platform ;
6
8
7
- import javax .annotation .Nullable ;
8
-
9
9
/**
10
10
* A builder to create a {@link SyncClient}; the builder itself should be created via
11
11
* {@link Sync#client(BoxStore, String, SyncCredentials)}.
@@ -19,12 +19,11 @@ public class SyncBuilder {
19
19
final String url ;
20
20
final SyncCredentials credentials ;
21
21
22
- @ Nullable
23
- String certificatePath ;
24
-
25
22
SyncClientListener listener ;
26
23
SyncChangesListener changesListener ;
27
24
25
+ @ Nullable
26
+ String [] trustedCertPaths ;
28
27
boolean uncommittedAcks ;
29
28
boolean manualStart ;
30
29
@@ -72,9 +71,15 @@ public SyncBuilder(BoxStore boxStore, String url, SyncCredentials credentials) {
72
71
this .credentials = credentials ;
73
72
}
74
73
75
- // TODO Check if this should remain exposed in the final API
76
- public SyncBuilder certificatePath (String certificatePath ) {
77
- this .certificatePath = certificatePath ;
74
+ /**
75
+ * Configures a custom set of directory or file paths to search for trusted certificates in.
76
+ * The first path that exists will be used.
77
+ * <p>
78
+ * Using this option is not recommended in most cases, as by default the sync client uses
79
+ * the certificate authorities trusted by the host platform.
80
+ */
81
+ public SyncBuilder trustedCertificates (String [] paths ) {
82
+ this .trustedCertPaths = paths ;
78
83
return this ;
79
84
}
80
85
0 commit comments