Class URLDownloadSource
-
- All Implemented Interfaces:
-
com.pspdfkit.document.download.source.DownloadSource
public class URLDownloadSource implements DownloadSource
Download using a URL (usually from the web). This source uses
URL#openConnection()
to access the PDF resource.
-
-
Constructor Summary
Constructors Constructor Description URLDownloadSource(URL documentURL)
Constructs the download source based on a URL.
-
Method Summary
Modifier and Type Method Description InputStream
open()
Opens an InputStream for downloading the document. long
getLength()
Returns the total length of the download. String
toString()
-
-
Method Detail
-
open
InputStream open()
Opens an InputStream for downloading the document.
- Returns:
A fresh input stream for downloading the PDF document.
-
getLength
long getLength()
Returns the total length of the download. This is optional and only used for calculating the Progress during download.
- Returns:
Total length of the download in bytes, or UNKNOWN_DOWNLOAD_SIZE.
-
-
-
-