use of net.osmand.plus.backup.NetworkWriter.OnUploadItemListener in project Osmand by osmandapp.
the class BackupExporter method exportItems.
private void exportItems() throws IOException {
AtomicInteger dataProgress = new AtomicInteger(0);
Set<Object> itemsProgress = Collections.synchronizedSet(new HashSet<>());
Map<String, String> errors = new ConcurrentHashMap<>();
OnUploadItemListener uploadItemListener = getOnUploadItemListener(itemsProgress, dataProgress, errors);
OnDeleteFilesListener deleteFilesListener = getOnDeleteFilesListener(itemsProgress, dataProgress);
NetworkWriter networkWriter = new NetworkWriter(backupHelper, uploadItemListener);
writeItems(networkWriter);
deleteFiles(deleteFilesListener);
deleteOldFiles(deleteFilesListener);
if (!isCancelled()) {
backupHelper.updateBackupUploadTime();
}
if (listener != null) {
listener.networkExportDone(errors);
}
}
Aggregations