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)
Sets the
outputFile for the download. | ||||||||||
DownloadRequest.Builder |
outputFolder(File outputFolder)
Sets 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)
Sets a
DownloadSource from which to download. | ||||||||||
DownloadRequest.Builder |
uri(Uri uri)
Sets 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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
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.
Sets the outputFile
for the download.
outputFile | Writable output File for the download.
|
---|
Sets 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.
|
---|
Sets a DownloadSource
from which to download.
source | DownloadSource pointing to the PDF document.
|
---|
Sets the download source from a Uri
.
Valid URI examples:
content://com.pspdfkit.viewer/documents/demo.pdf
file://android_asset/demo.pdf
https://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.
|
---|