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

SftpFileTransfer

class SftpFileTransfer : ProtocolFileTransfer

Constructors

<init>

SftpFileTransfer(aem: AemExtension)

Properties

clientOptions

var clientOptions: SshClient.() -> Unit

name

Unique identifier.

val name: String

password

var password: String?

protocols

val protocols: List<String>

sessionOptions

var sessionOptions: ClientSession.() -> Unit

timeout

var timeout: Long

user

var user: 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>