Skip to content

Latest commit

 

History

History
109 lines (88 loc) · 17.3 KB

index.md

File metadata and controls

109 lines (88 loc) · 17.3 KB

subkt / myaa.subkt.tasks / FTP

FTP

abstract class FTP : AbstractTransferTask<FTPClient> (source)

Task for uploading files via FTP. A predefined task instance can be accessed through Subs.ftp.

ftp {
    from(mux.batchItems())
    // copy mkv files in the 01/extra directory into a "bonus" directory
    from("01/extra") {
        include("*.mkv")
        into("bonus")
    }
    // directory to copy to
    into("/Downloads/My Show - 01")

    host("ftp.example.com")
    port(980)
    username("username")
    password("password")
    certificateVerificationMode(FTP.CertificateMode.ACCEPT_ALL)
    overwriteIf(OverwriteStrategy.DIFFERENT_SIZE_OR_SOURCE_NEWER)
}

Types

Name Summary
CertificateMode enum class CertificateMode
The strategy for verifying certificates when using FTPS.

Constructors

Name Summary
<init> FTP()
Task for uploading files via FTP. A predefined task instance can be accessed through Subs.ftp.

Properties

Name Summary
certificateVerificationMode val certificateVerificationMode: Property<FTP.CertificateMode>
The certificate verification strategy to use for SSL connections. Defaults to CertificateMode.VERIFY_NOT_EXPIRED.
host val host: Property<String>
The hostname or IP address of the FTP server.
implicitSsl val implicitSsl: Property<Boolean>
Whether to use implicit mode for the connection. Defaults to false.
password val password: Property<String>
The password for logging in to the FTP server.
port val port: Property<Int>
The port of the FTP server.
sslSessionReuse val sslSessionReuse: Property<Boolean>
If true, the same SSL session as the control channel will be used for data connections. Required for some servers, e.g. vsftpd with require_ssl_reuse enabled, but requires a hacky workaround for Java clients. Try disabling if you get strange issues. Defaults to true.
username val username: Property<String>
The username for logging in to the FTP server.
useSsl val useSsl: Property<Boolean>
Whether to encrypt the connection (FTPS). Defaults to true.

Inherited Properties

Name Summary
overwriteIf val overwriteIf: Property<OverwriteStrategy>
The overwriting strategy to use when encountering existing files with the same name. Defaults to OverwriteStrategy.DIFFERENT_SIZE.
progressLoggerFactory abstract val progressLoggerFactory: ProgressLoggerFactory

Functions

Name Summary
createClient open fun createClient(): FTPClient
makedir open fun makedir(client: FTPClient, path: String): Unit
stat open fun stat(client: FTPClient, file: String): AbstractTransferTask.FileDetails?
upload open fun upload(client: FTPClient, file: InputStream, dest: String, callback: (Long) -> Unit): Boolean

Inherited Functions

Name Summary
createCopyAction fun createCopyAction(): CopyAction
createRootSpec open fun createRootSpec(): AbstractTransferTask.DestDirRootSpec<T>
getRootSpec open fun getRootSpec(): AbstractTransferTask.DestDirRootSpec<*>
makedirs fun makedirs(client: T, path: String): Unit

Extension Properties

Name Summary
batch val Task.batch: String
The same as entry if this is a batch task; error otherwise.
currentTask val Task.currentTask: String
The name of this task.
entry val Task.entry: String
The entry (batch or episode) this task corresponds to.
episode val Task.episode: String
The same as entry if this is an episode task; error otherwise.
episodes val Task.episodes: List<String>
The episodes this task corresponds to. A single-item list containing episode if this is an episode task; a list of the episodes for the batch given by batch otherwise.
isBatch val Task.isBatch: Boolean
True if this task is a batch task.
release val Task.release: String
The release this task was generated for.
taskGroup val <T : Task> T.taskGroup: TaskGroup<T>
The TaskGroup instance this task belongs to.

Extension Functions

Name Summary
defaultProperty fun <T> Task.defaultProperty(default: T): Property<T>
Returns a Property with a default value set.
evaluate fun Task.evaluate(expression: String): Provider<List<String>!>!
Evaluates a string using Velocity, splits it on `
evaluateTemplate fun Task.evaluateTemplate(expression: String): Provider<String!>!
Like evaluate but only processes the template syntax, without globbing.
get fun Task.get(propertyName: String): Provider<String!>!
Searches for the given property in the Subs object's SubProperties instance, evaluates its value using evaluate, and returns a single string, assuming that the resulting list contains only one element.
getAs fun <T> Task.getAs(propertyName: String): Provider<T>!
Searches for the given property in the Subs object's SubProperties instance, evaluates its value using evaluate, and returns a single string, cast to the given type using String.asType, assuming that the resulting list contains only one element.
getFile fun Task.getFile(filename: String): Provider<String!>!
fun Task.getFile(filename: Provider<String>): Provider<String!>!
Reads the specified file and processes it using Velocity.
getList fun Task.getList(propertyName: String): Provider<List<String>>
Searches for the given property in the Subs object's SubProperties instance, and evaluates its value using evaluate.
getListAs fun <T> Task.getListAs(propertyName: String): Provider<List<T>!>!
Searches for the given property in the Subs object's SubProperties instance, evaluates its value using evaluate, and casts the list elements to the given type using String.asType.
getRaw fun Task.getRaw(propertyName: String): String
Searches for the given property in the Subs object's SubProperties instance, and returns the raw string. Raises an error if not found.
getRawMaybe fun Task.getRawMaybe(propertyName: String): String?
Searches for the given property in the Subs object's SubProperties instance, and returns the raw string, possibly null.
includeExtensions fun PatternFilterable.includeExtensions(vararg extensions: String): Unit
Filter files by file extension. Case-insensitive.
outputFile fun Task.outputFile(extension: String): ConfigurableFileCollection
Returns a ConfigurableFileCollection containing a single file taskName.extension located in the build directory.
propertyExists fun Task.propertyExists(propertyName: String): Boolean
Returns true if the given property exists in the Subs object's SubProperties instance for the given context.