-
- All Implemented Interfaces:
-
com.cognifide.gradle.common.file.transfer.FileTransfer,com.cognifide.gradle.common.file.transfer.FileTransferHandler,java.io.Serializable
public final class SftpFileTransfer extends ProtocolFileTransfer
-
-
Field Summary
Fields Modifier and Type Field Description private final Property<String>userprivate final Property<String>passwordprivate final Property<Long>timeoutprivate final Stringnameprivate final List<String>protocolsprivate final Property<Boolean>enabledprivate final Provider<Boolean>parallelable
-
Constructor Summary
Constructors Constructor Description SftpFileTransfer(CommonExtension common)
-
Method Summary
Modifier and Type Method Description final Unitclient(Function1<SshClient, Unit> options)final Unitsession(Function1<ClientSession, Unit> options)UnitdownloadFrom(String dirUrl, String fileName, File target)Downloads file with given name from directory available at specified URL. UnituploadTo(String dirUrl, String fileName, File source)Uploads file to directory available at specified URL and set given name. UnitdeleteFrom(String dirUrl, String fileName)Deletes file of given name in directory available at specified URL. List<FileEntry>list(String dirUrl)Lists files in directory available at specified URL. Unittruncate(String dirUrl)Deletes all files in directory available at specified URL. FileEntrystat(String dirUrl, String fileName)Gets file status of given name in directory at specified URL. final <T extends Any> Tconnect(String url, Function2<SftpClient, String, T> callback)final <T extends Any> TconnectDir(String dirUrl, Function2<SftpClient, String, T> callback)final Property<String>getUser()final Property<String>getPassword()final Property<Long>getTimeout()StringgetName()List<String>getProtocols()Property<Boolean>getEnabled()When enabled, transfer will be considered when finding transfer handling particular URL. Provider<Boolean>getParallelable()Determines if operations using this transfer could be done in parallel. -
Methods inherited from class com.cognifide.gradle.common.file.transfer.FileTransferHandler
delete, download, downloadTo, exists, exists, stat, upload, uploadTo -
Methods inherited from class com.cognifide.gradle.common.file.transfer.sftp.SftpFileTransfer
handles -
Methods inherited from class com.cognifide.gradle.common.file.transfer.ProtocolFileTransfer
download, downloader, uploader -
Methods inherited from class com.cognifide.gradle.common.file.transfer.FileTransfer
equals, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SftpFileTransfer
SftpFileTransfer(CommonExtension common)
-
-
Method Detail
-
session
final Unit session(Function1<ClientSession, Unit> options)
-
downloadFrom
Unit downloadFrom(String dirUrl, String fileName, File target)
Downloads file with given name from directory available at specified URL.
-
uploadTo
Unit uploadTo(String dirUrl, String fileName, File source)
Uploads file to directory available at specified URL and set given name.
-
deleteFrom
Unit deleteFrom(String dirUrl, String fileName)
Deletes file of given name in directory available at specified URL.
-
stat
FileEntry stat(String dirUrl, String fileName)
Gets file status of given name in directory at specified URL.
-
connectDir
final <T extends Any> T connectDir(String dirUrl, Function2<SftpClient, String, T> callback)
-
getPassword
final Property<String> getPassword()
-
getTimeout
final Property<Long> getTimeout()
-
getProtocols
List<String> getProtocols()
-
getEnabled
Property<Boolean> getEnabled()
When enabled, transfer will be considered when finding transfer handling particular URL.
-
getParallelable
Provider<Boolean> getParallelable()
Determines if operations using this transfer could be done in parallel.
-
-
-
-