MCPcopy Create free account
hub / github.com/FongMi/TV / restore

Method restore

app/src/main/java/com/fongmi/android/tv/db/AppDatabase.java:68–81  ·  view source on GitHub ↗
(File file, com.fongmi.android.tv.impl.Callback callback)

Source from the content-addressed store, hash-verified

66 }
67
68 public static void restore(File file, com.fongmi.android.tv.impl.Callback callback) {
69 Task.execute(() -> {
70 File restore = Path.cache("restore");
71 FileUtil.gzipDecompress(file, restore);
72 Backup backup = Backup.objectFrom(Path.read(restore));
73 if (backup.getConfig().isEmpty()) {
74 App.post(callback::error);
75 } else {
76 backup.restore();
77 Path.clear(restore);
78 App.post(callback::success);
79 }
80 });
81 }
82
83 private static void cleanOld() {
84 List<File> items = new ArrayList<>();

Callers 2

onItemClickMethod · 0.95
onItemClickMethod · 0.95

Calls 10

executeMethod · 0.95
cacheMethod · 0.95
gzipDecompressMethod · 0.95
objectFromMethod · 0.95
readMethod · 0.95
getConfigMethod · 0.95
postMethod · 0.95
restoreMethod · 0.95
clearMethod · 0.95
isEmptyMethod · 0.45

Tested by

no test coverage detected