public class FileDownloader extends FileOperation
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, KIFS_PATH_SEPARATOR, multiPartList, multiPartRemoteFileNames, namesOfFilesUploaded, opMode, recursive| Constructor and Description |
|---|
FileDownloader(GPUdb db,
List<String> fileNames,
String localDirName,
DownloadOptions downloadOptions,
FileDownloadListener callback,
GPUdbFileHandler.Options fileHandlerOptions)
Constructor
|
| 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.
|
String |
getEncoding() |
void |
setEncoding(String encoding) |
decideMultiPart, getFileInfoFromServer, getFileInfoFromServer, getKifsPathSeparator, getNamesOfFilesUploaded, localDirExists, localFileExists, parseFileNames, sortFilesIntoFullAndMultipartLists, traverseLocalDirectoriespublic FileDownloader(GPUdb db, List<String> fileNames, String localDirName, DownloadOptions downloadOptions, FileDownloadListener callback, GPUdbFileHandler.Options fileHandlerOptions) throws GPUdbException
db - - GPUdb - The GPUdb instancefileNames - - ListlocalDirName - - String - The name of the directory on the KIFS.downloadOptions - - DownloadOptions - Various optionscallback - - FileDownloadListener - The callback object usedfileHandlerOptions - - a GPUdbFileHandler.Options type objectGPUdbExceptionpublic String getEncoding()
public void setEncoding(String encoding)
public void download()
throws GPUdbException
downloadFullFiles() ()} and downloadMultiPartFiles() ()}GPUdbExceptionCopyright © 2024. All rights reserved.