public class FileDownloader extends FileOperation
filesystem
API. The consequences of using this class directly in
client code is not guaranteed and maybe undesirable.
This class handles downloading of either single part file or multiple part
downloads. This class extends the class FileOperation
and provides
additional functionalities of creating instances of DownloadIoJob
,
starting them and waiting for them to terminate.
The main exposed method to call is download()
()} which calls two
private methods named downloadFullFiles()
()} and
downloadMultiPartFiles()
()} respectively.
The method downloadFullFiles()
()} does the download by calling
the Java endpoint to download all files in one go.
The method downloadMultiPartFiles()
()} does the downloads
by creating background threads since each file could take a long time to
download. The multiple parts of a single file are downloaded sequentially in a
single thread and multiple files are downloaded in different threads.db, dirName, fileHandlerOptions, fileNames, fullFileBatchManager, fullFileList, fullRemoteFileNames, multiPartList, multiPartRemoteFileNames, namesOfFilesUploaded, opMode, recursive
Constructor and Description |
---|
FileDownloader(GPUdb db,
List<String> fileNames,
String localDirName,
DownloadOptions options,
FileDownloadListener callback,
GPUdbFileHandler.Options fileHandlerOptions)
Constructs a new
FileDownloader manager for downloading a given
set of files from a given KiFS directory to a local directory. |
Modifier and Type | Method and Description |
---|---|
void |
download()
This is the main download method which is to be called by the users of
this class.
|
decideMultiPart, getFileInfoFromServer, getKifsPathSeparator, getNamesOfFilesUploaded, localDirExists, localFileExists, parseFileNames, sortFilesIntoFullAndMultipartLists, traverseLocalDirectories
public FileDownloader(GPUdb db, List<String> fileNames, String localDirName, DownloadOptions options, FileDownloadListener callback, GPUdbFileHandler.Options fileHandlerOptions) throws GPUdbException
FileDownloader
manager for downloading a given
set of files from a given KiFS directory to a local directory.db
- The GPUdb
instance used to access KiFS.fileNames
- List of names of the KiFS files to download.localDirName
- Name of local directory to download to.options
- The DownloadOptions
object which is used to
configure the download operation.callback
- The callback FileDownloadListener
for this
download manager to notify as the download job progresses.fileHandlerOptions
- Options for setting up the files for transfer.GPUdbException
public void download() throws GPUdbException
downloadFullFiles()
()} and downloadMultiPartFiles()
()}GPUdbException
- If an error occurs transferring any of the files
from the server.Copyright © 2025. All rights reserved.