@@ -363,18 +363,20 @@ public void saveInBackground(SaveCallback callback) {
363
363
}
364
364
365
365
/**
366
- * Synchronously gets the data for this object. You probably want to use
367
- * {@link #getDataInBackground()} instead unless you're already in a background thread.
366
+ * Synchronously gets the data from cache if available or fetches its content from the network.
367
+ * You probably want to use {@link #getDataInBackground()} instead unless you're already in a
368
+ * background thread.
368
369
*/
369
370
public byte [] getData () throws ParseException {
370
371
return ParseTaskUtils .wait (getDataInBackground ());
371
372
}
372
373
373
374
/**
374
- * Gets the data for this object in a background thread.
375
+ * Asynchronously gets the data from cache if available or fetches its content from the network.
376
+ * A {@code ProgressCallback} will be called periodically with progress updates.
375
377
*
376
378
* @param progressCallback
377
- * A ProgressCallback that is called periodically with progress updates.
379
+ * A {@code ProgressCallback} that is called periodically with progress updates.
378
380
* @return A Task that is resolved when the data has been fetched.
379
381
*/
380
382
public Task <byte []> getDataInBackground (final ProgressCallback progressCallback ) {
@@ -421,7 +423,7 @@ public Task<byte[]> then(Task<byte[]> task) throws Exception {
421
423
}
422
424
423
425
/**
424
- * Gets the data for this object in a background thread .
426
+ * Asynchronously gets the data from cache if available or fetches its content from the network .
425
427
*
426
428
* @return A Task that is resolved when the data has been fetched.
427
429
*/
@@ -430,41 +432,46 @@ public Task<byte[]> getDataInBackground() {
430
432
}
431
433
432
434
/**
433
- * Gets the data for this object in a background thread.
435
+ * Asynchronously gets the data from cache if available or fetches its content from the network.
436
+ * A {@code ProgressCallback} will be called periodically with progress updates.
437
+ * A {@code GetDataCallback} will be called when the get completes.
434
438
*
435
439
* @param dataCallback
436
- * A GetDataCallback that is called when the get completes.
440
+ * A {@code GetDataCallback} that is called when the get completes.
437
441
* @param progressCallback
438
- * A ProgressCallback that is called periodically with progress updates.
442
+ * A {@code ProgressCallback} that is called periodically with progress updates.
439
443
*/
440
444
public void getDataInBackground (GetDataCallback dataCallback ,
441
445
final ProgressCallback progressCallback ) {
442
446
ParseTaskUtils .callbackOnMainThreadAsync (getDataInBackground (progressCallback ), dataCallback );
443
447
}
444
448
445
449
/**
446
- * Gets the data for this object in a background thread.
450
+ * Asynchronously gets the data from cache if available or fetches its content from the network.
451
+ * A {@code GetDataCallback} will be called when the get completes.
447
452
*
448
453
* @param dataCallback
449
- * A GetDataCallback that is called when the get completes.
454
+ * A {@code GetDataCallback} that is called when the get completes.
450
455
*/
451
456
public void getDataInBackground (GetDataCallback dataCallback ) {
452
457
ParseTaskUtils .callbackOnMainThreadAsync (getDataInBackground (), dataCallback );
453
458
}
454
459
455
460
/**
456
- * Synchronously gets the file pointer for this object. You probably want to use
457
- * {@link #getFileInBackground()} instead unless you're already in a background thread.
461
+ * Synchronously gets the file pointer from cache if available or fetches its content from the
462
+ * network. You probably want to use {@link #getFileInBackground()} instead unless you're already
463
+ * in a background thread.
458
464
*/
459
465
public File getFile () throws ParseException {
460
466
return ParseTaskUtils .wait (getFileInBackground ());
461
467
}
462
468
463
469
/**
464
- * Gets the file pointer for this object in a background thread.
470
+ * Asynchronously gets the file pointer from cache if available or fetches its content from the
471
+ * network. The {@code ProgressCallback} will be called periodically with progress updates.
465
472
*
466
473
* @param progressCallback
467
- * A ProgressCallback that is called periodically with progress updates.
474
+ * A {@code ProgressCallback} that is called periodically with progress updates.
468
475
* @return A Task that is resolved when the file pointer of this object has been fetched.
469
476
*/
470
477
public Task <File > getFileInBackground (final ProgressCallback progressCallback ) {
@@ -487,7 +494,8 @@ public Task<File> then(Task<File> task) throws Exception {
487
494
}
488
495
489
496
/**
490
- * Gets the file pointer for this object in a background thread.
497
+ * Asynchronously gets the file pointer from cache if available or fetches its content from the
498
+ * network.
491
499
*
492
500
* @return A Task that is resolved when the data has been fetched.
493
501
*/
@@ -496,42 +504,50 @@ public Task<File> getFileInBackground() {
496
504
}
497
505
498
506
/**
499
- * Gets the file pointer for this object in a background thread. `progressCallback` is guaranteed
500
- * to be called with 100 before `fileCallback` is called.
507
+ * Asynchronously gets the file pointer from cache if available or fetches its content from the
508
+ * network. The {@code GetFileCallback} will be called when the get completes.
509
+ * The {@code ProgressCallback} will be called periodically with progress updates.
510
+ * The {@code ProgressCallback} is guaranteed to be called with 100 before the
511
+ * {@code GetFileCallback} is called.
501
512
*
502
513
* @param fileCallback
503
- * A GetFileCallback that is called when the get completes.
514
+ * A {@code GetFileCallback} that is called when the get completes.
504
515
* @param progressCallback
505
- * A ProgressCallback that is called periodically with progress updates.
516
+ * A {@code ProgressCallback} that is called periodically with progress updates.
506
517
*/
507
518
public void getFileInBackground (GetFileCallback fileCallback ,
508
519
final ProgressCallback progressCallback ) {
509
520
ParseTaskUtils .callbackOnMainThreadAsync (getFileInBackground (progressCallback ), fileCallback );
510
521
}
511
522
512
523
/**
513
- * Gets the file pointer for this object in a background thread.
524
+ * Asynchronously gets the file pointer from cache if available or fetches its content from the
525
+ * network. The {@code GetFileCallback} will be called when the get completes.
514
526
*
515
527
* @param fileCallback
516
- * A GetFileCallback that is called when the get completes.
528
+ * A {@code GetFileCallback} that is called when the get completes.
517
529
*/
518
530
public void getFileInBackground (GetFileCallback fileCallback ) {
519
531
ParseTaskUtils .callbackOnMainThreadAsync (getFileInBackground (), fileCallback );
520
532
}
521
533
522
534
/**
523
- * Synchronously gets the data stream for this object. You probably want to use
524
- * {@link #getDataStreamInBackground} instead unless you're already in a background thread.
535
+ * Synchronously gets the data stream from cached file if available or fetches its content from
536
+ * the network, saves the content as cached file and returns the data stream of the cached file.
537
+ * You probably want to use {@link #getDataStreamInBackground} instead unless you're already in a
538
+ * background thread.
525
539
*/
526
540
public InputStream getDataStream () throws ParseException {
527
541
return ParseTaskUtils .wait (getDataStreamInBackground ());
528
542
}
529
543
530
544
/**
531
- * Gets the data stream for this object in a background thread.
545
+ * Asynchronously gets the data stream from cached file if available or fetches its content from
546
+ * the network, saves the content as cached file and returns the data stream of the cached file.
547
+ * The {@code ProgressCallback} will be called periodically with progress updates.
532
548
*
533
549
* @param progressCallback
534
- * A ProgressCallback that is called periodically with progress updates.
550
+ * A {@code ProgressCallback} that is called periodically with progress updates.
535
551
* @return A Task that is resolved when the data stream of this object has been fetched.
536
552
*/
537
553
public Task <InputStream > getDataStreamInBackground (final ProgressCallback progressCallback ) {
@@ -559,7 +575,8 @@ public Task<InputStream> then(Task<InputStream> task) throws Exception {
559
575
}
560
576
561
577
/**
562
- * Gets the data stream for this object in a background thread.
578
+ * Asynchronously gets the data stream from cached file if available or fetches its content from
579
+ * the network, saves the content as cached file and returns the data stream of the cached file.
563
580
*
564
581
* @return A Task that is resolved when the data stream has been fetched.
565
582
*/
@@ -568,13 +585,17 @@ public Task<InputStream> getDataStreamInBackground() {
568
585
}
569
586
570
587
/**
571
- * Gets the data stream for this object in a background thread. `progressCallback` is guaranteed
572
- * to be called with 100 before `dataStreamCallback` is called.
588
+ * Asynchronously gets the data stream from cached file if available or fetches its content from
589
+ * the network, saves the content as cached file and returns the data stream of the cached file.
590
+ * The {@code GetDataStreamCallback} will be called when the get completes. The
591
+ * {@code ProgressCallback} will be called periodically with progress updates. The
592
+ * {@code ProgressCallback} is guaranteed to be called with 100 before
593
+ * {@code GetDataStreamCallback} is called.
573
594
*
574
595
* @param dataStreamCallback
575
- * A GetDataCallback that is called when the get completes.
596
+ * A {@code GetDataStreamCallback} that is called when the get completes.
576
597
* @param progressCallback
577
- * A ProgressCallback that is called periodically with progress updates.
598
+ * A {@code ProgressCallback} that is called periodically with progress updates.
578
599
*/
579
600
public void getDataStreamInBackground (GetDataStreamCallback dataStreamCallback ,
580
601
final ProgressCallback progressCallback ) {
@@ -583,10 +604,12 @@ public void getDataStreamInBackground(GetDataStreamCallback dataStreamCallback,
583
604
}
584
605
585
606
/**
586
- * Gets the data stream for this object in a background thread.
607
+ * Asynchronously gets the data stream from cached file if available or fetches its content from
608
+ * the network, saves the content as cached file and returns the data stream of the cached file.
609
+ * The {@code GetDataStreamCallback} will be called when the get completes.
587
610
*
588
611
* @param dataStreamCallback
589
- * A GetDataCallback that is called when the get completes.
612
+ * A {@code GetDataStreamCallback} that is called when the get completes.
590
613
*/
591
614
public void getDataStreamInBackground (GetDataStreamCallback dataStreamCallback ) {
592
615
ParseTaskUtils .callbackOnMainThreadAsync (getDataStreamInBackground (), dataStreamCallback );
0 commit comments