This repository was archived by the owner on Jan 31, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
algoliasearch/src/offline/java/com/algolia/search/saas Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -233,12 +233,6 @@ protected LocalIndex getLocalIndex() {
233
233
return localIndex ;
234
234
}
235
235
236
- private File getTempDir ()
237
- {
238
- // TODO: Use better value
239
- return getClient ().getRootDataDir ();
240
- }
241
-
242
236
private File getDataDir ()
243
237
{
244
238
return new File (new File (getClient ().getRootDataDir (), getClient ().getApplicationID ()), getIndexName ());
@@ -435,7 +429,7 @@ public void run()
435
429
436
430
try {
437
431
// Create temporary directory.
438
- tmpDir = new File (getTempDir (), UUID .randomUUID ().toString ());
432
+ tmpDir = new File (getClient (). getTempDir (), UUID .randomUUID ().toString ());
439
433
tmpDir .mkdirs ();
440
434
441
435
// NOTE: We are doing everything sequentially, because this is a background job: we care more about
Original file line number Diff line number Diff line change @@ -127,6 +127,15 @@ public MirroredIndex initIndex(@NonNull String indexName)
127
127
return rootDataDir ;
128
128
}
129
129
130
+ /**
131
+ * Get the path to the temporary directory used by this client.
132
+ *
133
+ * @return The path to the temporary directory.
134
+ */
135
+ protected @ NonNull File getTempDir () {
136
+ return context .getCacheDir ();
137
+ }
138
+
130
139
/**
131
140
* Enable the offline mode.
132
141
* @param licenseData License for Algolia's SDK.
You can’t perform that action at this time.
0 commit comments