SHARE
TWEET

Untitled

a guest Jul 21st, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class CollectorExporter constructor(context: Context,
  2.                                     private val executor: AppExecutor,
  3.                                     private val sync: Sync = SyncClient(context)) {
  4.  
  5.   fun export(analyticsFolder: File, metadataFolder: File, collectorNetworkAddress: String, executor: ListeningExecutorService = this.executor, uploadFolder: String):
  6.       ListenableFuture<Unit> {
  7.  
  8.     return executor.submit(Callable {
  9.       sync.sync(analyticsFolder.absolutePath, collectorNetworkAddress, uploadFolder)
  10.  
  11.       sync.sync(metadataFolder.absolutePath, collectorNetworkAddress, uploadFolder)
  12.     })
  13.   }
  14.  
  15.   fun export(file: File, collectorNetworkAddress: String, executor: ListeningExecutorService = this.executor, uploadFolder: String): ListenableFuture<Unit> {
  16.     return executor.submit(Callable {
  17.       sync.sync(file.absolutePath, collectorNetworkAddress, uploadFolder)
  18.     })
  19.   }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top