| java.lang.Object | |
| ↳ | com.pspdfkit.document.download.DownloadRequest.Builder |
Builder for a DownloadRequest.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Builder(Context context)
Create a builder with default settings.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| DownloadRequest |
build()
Create a
DownloadRequest from the current settings. | ||||||||||
| DownloadRequest.Builder |
outputFile(File outputFile)
Set the
outputFile for the download. | ||||||||||
| DownloadRequest.Builder |
outputFolder(File outputFolder)
Set the
outputFolder for the download. | ||||||||||
| DownloadRequest.Builder |
overwriteExisting(boolean overwriteExisting)
If set to
true and the outputFile already exists, the download re-download the document. | ||||||||||
| DownloadRequest.Builder |
source(DownloadSource source)
Set a
DownloadSource from which to download. | ||||||||||
| DownloadRequest.Builder |
uri(Uri uri)
Set the download source from a
Uri. | ||||||||||
| DownloadRequest.Builder | uri(String uri) | ||||||||||
| DownloadRequest.Builder |
useTemporaryOutputFile(boolean useTemporaryOutputFile)
If set to
true, the download will write to a temporary file with the same path and filename as the output file but append
.tmp to it. | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a builder with default settings.
| context | Context for resolving resources. |
|---|
Create a DownloadRequest from the current settings.
DownloadRequest based on the current builder settings.
Set the outputFile for the download.
| outputFile | Writable output File for the download.
|
|---|
Set the outputFolder for the download. When using this method the PDF will use a generated filename derived from the system time. If
you want to explicitly specify the output filename use outputFile(File) instead.
| outputFolder | File pointing to the download output directory.
|
|---|
If set to true and the outputFile already exists, the download re-download the document. If set to false the
download will complete immediately returning the existing file.
| overwriteExisting | true to re-download in case the output file already exists.
|
|---|
Set a DownloadSource from which to download.
| source | DownloadSource pointing to the PDF document.
|
|---|
Set the download source from a Uri.
Valid URI examples:
content://com.pspdfkit.viewer/documents/demo.pdffile://android_asset/demo.pdfhttps://www.example.com/demo.pdf| uri | Uri of the document to download. |
|---|
| IllegalArgumentException | If the given uri was unrecognized or invalid.
|
|---|
If set to true, the download will write to a temporary file with the same path and filename as the output file but append
.tmp to it. If false the download will be written directly into the output file. Defaults to true.
| useTemporaryOutputFile | true to use a temporary output file while downloading, or false to directly write into the
ultimate output file.
|
|---|