common-plugin / com.cognifide.gradle.common.file.transfer.sftp / SftpFileTransfer

SftpFileTransfer

class SftpFileTransfer : ProtocolFileTransfer

Constructors

<init>

SftpFileTransfer(common: CommonExtension)

Properties

name

Unique identifier.

val name: String

password

val password: Property<String!>!

protocols

val protocols: List<String>

timeout

val timeout: Property<Long!>!

user

val user: Property<String!>!

Functions

client

fun client(options: SshClient.() -> Unit): Unit

connect

fun <T> connect(url: String, callback: SftpClient.(String) -> T): T

connectDir

fun <T> connectDir(dirUrl: String, callback: SftpClient.(String) -> T): T

deleteFrom

Deletes file of given name in directory available at specified URL.

fun deleteFrom(dirUrl: String, fileName: String): Unit

downloadFrom

Downloads file with given name from directory available at specified URL.

fun downloadFrom(dirUrl: String, fileName: String, target: File): Unit

list

Lists files in directory available at specified URL.

fun list(dirUrl: String): List<FileEntry>

session

fun session(options: ClientSession.() -> Unit): Unit

stat

Gets file status of given name in directory at specified URL.

fun stat(dirUrl: String, fileName: String): FileEntry?

truncate

Deletes all files in directory available at specified URL.

fun truncate(dirUrl: String): Unit

uploadTo

Uploads file to directory available at specified URL and set given name.

fun uploadTo(dirUrl: String, fileName: String, source: File): Unit

Companion Object Properties

NAME

const val NAME: String

PORT_DEFAULT

const val PORT_DEFAULT: Int

STATUS_NOT_EXISTS

val STATUS_NOT_EXISTS: Array<Int>