public final class

ContentResolverDownloadSource

extends Object
implements DownloadSource
java.lang.Object
   ↳ com.pspdfkit.document.download.source.ContentResolverDownloadSource

Class Overview

A source for downloading a document from a ContentProvider.

Summary

[Expand]
Inherited Constants
From interface com.pspdfkit.document.download.source.DownloadSource
Public Constructors
ContentResolverDownloadSource(Context context, Uri uri)
Constructor taking a uri pointing to a content provider.
Public Methods
long getLength()
Returns the total length of the download.
Uri getUri()
Returns the Uri pointing to the content provider served document.
InputStream open()
Opens an InputStream for downloading the document.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pspdfkit.document.download.source.DownloadSource

Public Constructors

public ContentResolverDownloadSource (Context context, Uri uri)

Constructor taking a uri pointing to a content provider. The uri has to use the content:// scheme.

Parameters
context Context for accessing the document using a content resolver.
uri The Uri pointing to a document of a content provider.

Public Methods

public long getLength ()

Returns the total length of the download. This is optional and only used for calculating the Progress during download.

Returns

public Uri getUri ()

Returns the Uri pointing to the content provider served document.

Returns
  • A Uri pointing to a content provider PDF document.

public InputStream open ()

Opens an InputStream for downloading the document.

Returns
  • A fresh input stream for downloading the PDF document.
Throws
IOException

public String toString ()