public class CacheGenieFileTransferService extends GenieFileTransferService
Constructor and Description |
---|
CacheGenieFileTransferService(FileTransferFactory fileTransferFactory,
java.lang.String baseCacheLocation,
LocalFileTransferImpl localFileTransfer,
com.netflix.spectator.api.Registry registry)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.nio.file.Path |
createDirectories(java.lang.String path) |
protected void |
deleteFile(java.io.File file) |
void |
getFile(java.lang.String srcRemotePath,
java.lang.String dstLocalPath)
Get the file needed by Genie for job execution.
|
protected java.io.File |
loadFile(java.lang.String path)
Loads the file given the path and stores it under the cache location with file name as UUID string created using
the path.
|
getFileTransfer, putFile
public CacheGenieFileTransferService(@NotNull FileTransferFactory fileTransferFactory, @NotNull java.lang.String baseCacheLocation, @NotNull LocalFileTransferImpl localFileTransfer, @NotNull com.netflix.spectator.api.Registry registry) throws GenieException
fileTransferFactory
- file transfer implementation factorybaseCacheLocation
- file cache locationlocalFileTransfer
- Local file transfer serviceregistry
- spectator registryGenieException
- If there is any problempublic void getFile(@NotBlank(message="Source file path cannot be empty.") java.lang.String srcRemotePath, @NotBlank(message="Destination local path cannot be empty") java.lang.String dstLocalPath) throws GenieException
getFile
in class GenieFileTransferService
srcRemotePath
- Path of the file in the remote location to be fetcheddstLocalPath
- Local path where the file needs to be placedGenieException
- If there is any problemprotected void deleteFile(java.io.File file) throws java.io.IOException
java.io.IOException
protected java.nio.file.Path createDirectories(java.lang.String path) throws GenieException
GenieException
protected java.io.File loadFile(java.lang.String path) throws GenieException
path
- Path of the file to be loadedGenieException
- Exception if the file does not load