public class FileUploader extends FileOperation
FileOperation
and provides
additional functionalities of creating instances of UploadIoJob
,
starting them and waiting for them to terminate.
The main exposed method to call is upload()
which calls two private
methods named uploadFullFiles()
and uploadMultiPartFiles()
respectively.
The method uploadFullFiles()
does the upload by calling the Jave
endpoint to upload all files in one go.
The method uploadMultiPartFiles()
does the uploads by creating
background threads since each file could take a long time to upload.
The multiple parts of a single file are uploaded sequentially in a single
thread and multiple files are uploaded in different threads.db, dirName, fileHandlerOptions, fileNames, fullFileBatchManager, fullFileList, fullRemoteFileNames, KIFS_PATH_SEPARATOR, multiPartList, multiPartRemoteFileNames, namesOfFilesUploaded, opMode, recursive
Constructor and Description |
---|
FileUploader(GPUdb db,
List<String> fileNames,
String remoteDirName,
UploadOptions options,
FileUploadListener callback,
GPUdbFileHandler.Options fileHandlerOptions)
Constructor -
|
Modifier and Type | Method and Description |
---|---|
String |
getEncoding() |
int |
getRankForLocalDist() |
UploadOptions |
getUploadOptions() |
void |
setEncoding(String encoding) |
void |
setRankForLocalDist(int rankForLocalDist) |
void |
setUploadOptions(UploadOptions uploadOptions) |
void |
upload()
This is the main upload method which is to be called by the users of
this class.
|
decideMultiPart, getFileInfoFromServer, getFileInfoFromServer, getKifsPathSeparator, getNamesOfFilesUploaded, localDirExists, localFileExists, parseFileNames, sortFilesIntoFullAndMultipartLists, traverseLocalDirectories
public FileUploader(GPUdb db, List<String> fileNames, String remoteDirName, UploadOptions options, FileUploadListener callback, GPUdbFileHandler.Options fileHandlerOptions) throws GPUdbException
db
- - The GPUdb
instancefileNames
- - ListremoteDirName
- - String - Name of remote directory under KIFSoptions
- - The UploadOptions
object which is used to
configure the upload operation.GPUdbException
public void upload() throws GPUdbException
uploadFullFiles()
and uploadMultiPartFiles()
GPUdbException
public UploadOptions getUploadOptions()
public void setUploadOptions(UploadOptions uploadOptions)
public int getRankForLocalDist()
public void setRankForLocalDist(int rankForLocalDist)
public String getEncoding()
public void setEncoding(String encoding)
Copyright © 2024. All rights reserved.