Add some javadoc for ProgressListener changes.

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-06-26 10:15:41 -07:00
parent e7f1c52eb2
commit c36d13057c
2 changed files with 29 additions and 0 deletions

View File

@ -90,6 +90,25 @@ public class TextSecureMessageReceiver {
* @throws IOException
* @throws InvalidMessageException
*/
public InputStream retrieveAttachment(TextSecureAttachmentPointer pointer, File destination)
throws IOException, InvalidMessageException
{
return retrieveAttachment(pointer, destination, null);
}
/**
* Retrieves a TextSecure attachment.
*
* @param pointer The {@link org.whispersystems.textsecure.api.messages.TextSecureAttachmentPointer}
* received in a {@link TextSecureDataMessage}.
* @param destination The download destination for this attachment.
* @param listener An optional listener (may be null) to receive callbacks on download progress.
*
* @return An InputStream that streams the plaintext attachment contents.
* @throws IOException
* @throws InvalidMessageException
*/
public InputStream retrieveAttachment(TextSecureAttachmentPointer pointer, File destination, ProgressListener listener)
throws IOException, InvalidMessageException
{

View File

@ -83,7 +83,17 @@ public abstract class TextSecureAttachment {
}
}
/**
* An interface to receive progress information on upload/download of
* an attachment.
*/
public interface ProgressListener {
/**
* Called on a progress change event.
*
* @param total The total amount to transmit/receive in bytes.
* @param progress The amount that has been transmitted/received in bytes thus far
*/
public void onAttachmentProgress(long total, long progress);
}
}