@@ -66,13 +66,9 @@ public class BoxStoreBuilder {
66
66
67
67
final byte [] model ;
68
68
69
- /** BoxStore uses this */
69
+ /** BoxStore uses this (not baseDirectory/name) */
70
70
File directory ;
71
71
72
- /** On Android used for native library loading. */
73
- @ Nullable Object context ;
74
- @ Nullable Object relinker ;
75
-
76
72
/** Ignored by BoxStore */
77
73
private File baseDirectory ;
78
74
@@ -82,6 +78,10 @@ public class BoxStoreBuilder {
82
78
/** Defaults to {@link #DEFAULT_MAX_DB_SIZE_KBYTE}. */
83
79
long maxSizeInKByte = DEFAULT_MAX_DB_SIZE_KBYTE ;
84
80
81
+ /** On Android used for native library loading. */
82
+ @ Nullable Object context ;
83
+ @ Nullable Object relinker ;
84
+
85
85
ModelUpdate modelUpdate ;
86
86
87
87
int debugFlags ;
@@ -90,7 +90,7 @@ public class BoxStoreBuilder {
90
90
91
91
boolean debugRelations ;
92
92
93
- long fileMode ;
93
+ int fileMode ;
94
94
95
95
int maxReaders ;
96
96
@@ -279,10 +279,11 @@ private static File getAndroidFilesDir(Object context) {
279
279
/**
280
280
* Specify
281
281
* <a href="https://en.wikipedia.org/wiki/File_system_permissions#Numeric_notation">unix-style file permissions</a>
282
- * to use for the database directory and files.
283
- * E.g. for {@code rw-rw-rw-} (owner, group, other) pass the octal code {@code 666}.
282
+ * for database files. E.g. for {@code -rw-r----} (owner, group, other) pass the octal code {@code 0640}.
283
+ * Any newly generated directory additionally gets searchable (01) for groups with read or write permissions.
284
+ * It's not allowed to pass in an executable flag.
284
285
*/
285
- public BoxStoreBuilder fileMode (long mode ) {
286
+ public BoxStoreBuilder fileMode (int mode ) {
286
287
this .fileMode = mode ;
287
288
return this ;
288
289
}
@@ -327,9 +328,7 @@ public BoxStoreBuilder maxSizeInKByte(long maxSizeInKByte) {
327
328
}
328
329
329
330
/**
330
- * Open the store in read-only mode: no schema update, no write transactions.
331
- * <p>
332
- * It is recommended to use this with {@link #usePreviousCommit()} to ensure no data is lost.
331
+ * Open the store in read-only mode: no schema update, no write transactions are allowed (would throw).
333
332
*/
334
333
public BoxStoreBuilder readOnly () {
335
334
this .readOnly = true ;
@@ -341,7 +340,8 @@ public BoxStoreBuilder readOnly() {
341
340
* When used with care (e.g. backup the DB files first), this option may also recover data removed by the latest
342
341
* transaction.
343
342
* <p>
344
- * It is recommended to use this with {@link #readOnly()} to ensure no data is lost.
343
+ * To ensure no data is lost accidentally, it is recommended to use this in combination with {@link #readOnly()}
344
+ * to examine and validate the database first.
345
345
*/
346
346
public BoxStoreBuilder usePreviousCommit () {
347
347
this .usePreviousCommit = true ;
0 commit comments