public class HttpFileTransferImpl extends java.lang.Object implements FileTransfer
| Constructor and Description |
|---|
HttpFileTransferImpl(@NotNull org.springframework.web.client.RestTemplate restTemplate,
@NotNull io.micrometer.core.instrument.MeterRegistry registry)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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)
Gets a file from any remote location to Genie's local working directory.
|
long |
getLastModifiedTime(java.lang.String path)
Returns the last modified time of the file with the given path.
|
boolean |
isValid(java.lang.String fileName)
This method validates whether it can handle operations for a particular file
based on the prefix of the file like s3://, hdfs:// etc.
|
void |
putFile(@NotBlank(message="Source local path cannot be empty.") java.lang.String srcLocalPath,
@NotBlank(message="Destination remote path cannot be empty") java.lang.String dstRemotePath)
Puts a file from Genie's local working directory to a remote location.
|
public HttpFileTransferImpl(@NotNull
@NotNull org.springframework.web.client.RestTemplate restTemplate,
@NotNull
@NotNull io.micrometer.core.instrument.MeterRegistry registry)
restTemplate - The rest template to useregistry - The metrics registry to usepublic boolean isValid(java.lang.String fileName)
throws com.netflix.genie.common.exceptions.GenieException
isValid in interface FileTransferfileName - file name to validatecom.netflix.genie.common.exceptions.GenieException - if there are errorspublic void getFile(@NotBlank(message="Source file path cannot be empty.")
@NotBlank(message="Source file path cannot be empty.") java.lang.String srcRemotePath,
@NotBlank(message="Destination local path cannot be empty")
@NotBlank(message="Destination local path cannot be empty") java.lang.String dstLocalPath)
throws com.netflix.genie.common.exceptions.GenieException
getFile in interface FileTransfersrcRemotePath - Source path of the files to copydstLocalPath - Destination path of the files to copy tocom.netflix.genie.common.exceptions.GenieException - exception in case of an errorpublic void putFile(@NotBlank(message="Source local path cannot be empty.")
@NotBlank(message="Source local path cannot be empty.") java.lang.String srcLocalPath,
@NotBlank(message="Destination remote path cannot be empty")
@NotBlank(message="Destination remote path cannot be empty") java.lang.String dstRemotePath)
throws com.netflix.genie.common.exceptions.GenieException
putFile in interface FileTransfersrcLocalPath - Source path of the files to copydstRemotePath - Destination path of the files to copy tocom.netflix.genie.common.exceptions.GenieException - exception in case of an errorpublic long getLastModifiedTime(java.lang.String path)
throws com.netflix.genie.common.exceptions.GenieException
getLastModifiedTime in interface FileTransferpath - location of the filecom.netflix.genie.common.exceptions.GenieException - exception in case of IO error