public final class DownloadManagerBuilder
extends java.lang.Object
DownloadManager to be used for downloading remote files to a local download location.
The local download location must be specified when creating the builder.
A PermissionsManager may optionally be specified to have to the repository manage file permissions.
Add download managers (Downloader or WorkspaceDownloader) for each type of remote source to download from.
Call build to retrieve the DownloadManager| Constructor and Description |
|---|
DownloadManagerBuilder()
Starts building a
DownloadManager without a repository root. |
DownloadManagerBuilder(java.lang.String downloadLocation)
Starts building a
DownloadManager with the path to the download location. |
DownloadManagerBuilder(java.lang.String downloadLocation,
PermissionsManager permissions)
Starts building a
DownloadManager with the path to the download location and a PermissionsManager. |
| Modifier and Type | Method and Description |
|---|---|
DownloadManagerBuilder |
addDownloader(Downloader downloader)
Adds a
Downloader to support downloading from a specific remote source. |
DownloadManagerBuilder |
addDownloader(WorkspaceDownloader workspaceDownloader)
Adds a
WorkspaceDownloader to support downloading from a specific remote source. |
DownloadManager |
build()
Builds a
DownloadManager based on previous calls to the builder. |
public DownloadManagerBuilder()
DownloadManager without a repository root.
Not having a repository means this builder will not be able to add any WorkspaceDownloader.
This builder will create a very limited DownloadManager.public DownloadManagerBuilder(java.lang.String downloadLocation)
DownloadManager with the path to the download location.
The download location should be a path representing a local filesystem directory that will be used as the repository's root directory for downloading.
If the directory does not exist then it will be created, along with any parent directories that do not exist.
This constructor creates a repository that does not manages file permissions.downloadLocation - a local filesystem path the repository will use as a root directory for downloading.public DownloadManagerBuilder(java.lang.String downloadLocation,
PermissionsManager permissions)
DownloadManager with the path to the download location and a PermissionsManager.
The download location should be a path representing a local filesystem directory that will be used as the repository's root directory for downloading.
If the directory does not exist then it will be created, along with any missing parent directories.
Each created directory created will be passed through the supplied PermissionsManager.
The PermissionsManager will be handle all files created or downloaded under the download location.downloadLocation - a local filesystem path the repository will use as a root directory for downloading.permissions - a permissions manager will apply permissions after a resource is downloadedpublic DownloadManagerBuilder addDownloader(Downloader downloader)
Downloader to support downloading from a specific remote source.
If multiple download managers claim to support a path then the download manager added first will be used.downloader - a download manager to add to the supported download managers for the repository being builtpublic DownloadManagerBuilder addDownloader(WorkspaceDownloader workspaceDownloader)
WorkspaceDownloader to support downloading from a specific remote source.
If multiple download managers claim to support a path then the download manager added first will be used.
A WorkspaceDownloader is a download manager that uses workspaces. Workspaces are unique directories for each download path.workspaceDownloader - a workspace download manager to add to the supported download managers for the repository being builtpublic DownloadManager build()
DownloadManager based on previous calls to the builder.© 2018, 2020 Precisely. All rights reserved.