The OpenD Programming Language

FTP

FTP client functionality.

struct FTP {}

Members

Aliases

CurlProxy
alias CurlProxy = etc.c.curl.CurlProxy

Type of proxy

requestAbort
alias requestAbort = CurlReadFunc.abort

Value to return from onSend delegate in order to abort a request

requestPause
alias requestPause = CurlReadFunc.pause

Value to return from onSend/onReceive delegates in order to pause a request

Functions

addCommand
void addCommand(const(char)[] command)

Add a command to send to ftp server.

clearCommands
void clearCommands()

Clear all commands send to ftp server.

dup
FTP dup()
getTiming
CurlCode getTiming(CurlInfo timing, double val)

Get various timings defined in etc.c.curl.CurlInfo. The value is usable only if the return value is equal to etc.c.curl.CurlError.ok.

perform
CurlCode perform(ThrowOnError throwOnError)

Performs the ftp request as it has been configured.

setAuthentication
void setAuthentication(const(char)[] username, const(char)[] password, const(char)[] domain)

Set the user name, password and optionally domain for authentication purposes.

setProxyAuthentication
void setProxyAuthentication(const(char)[] username, const(char)[] password)

Set the user name and password for proxy authentication.

shutdown
void shutdown()

Stop and invalidate this instance.

Properties

connectTimeout
Duration connectTimeout [@property setter]

Set timeout for connecting.

contentLength
ulong contentLength [@property setter]

The content length in bytes of the ftp data.

dataTimeout
Duration dataTimeout [@property setter]

Set timeout for activity on connection.

dnsTimeout
Duration dnsTimeout [@property setter]

DNS lookup timeout.

encoding
string encoding [@property setter]
string encoding [@property getter]

Connection encoding. Defaults to ISO-8859-1.

isStopped
bool isStopped [@property getter]

True if the instance is stopped. A stopped instance is not usable.

localPort
ushort localPort [@property setter]

Set the local outgoing port to use.

localPortRange
ushort localPortRange [@property setter]

Set the local outgoing port range to use. This can be used together with the localPort property.

netInterface
const(char)[] netInterface [@property setter]
const(ubyte)[4] netInterface [@property setter]
InternetAddress netInterface [@property setter]

The network interface to use in form of the IP of the interface.

onProgress
int delegate(size_t dlTotal, size_t dlNow, size_t ulTotal, size_t ulNow) onProgress [@property setter]

The event handler that gets called to inform of upload/download progress.

onReceive
size_t delegate(ubyte[]) onReceive [@property setter]

The event handler that receives incoming data. Be sure to copy the incoming ubyte[] since it is not guaranteed to be valid after the callback returns.

onSend
size_t delegate(void[]) onSend [@property setter]

The event handler that gets called when data is needed for sending. The length of the void[] specifies the maximum number of bytes that can be sent.

operationTimeout
Duration operationTimeout [@property setter]

Set maximum time an operation is allowed to take. This includes dns resolution, connecting, data transfer, etc.

proxy
const(char)[] proxy [@property setter]

Proxy See: _proxy

proxyPort
ushort proxyPort [@property setter]

Proxy port See: _proxy_port

proxyType
CurlProxy proxyType [@property setter]

Proxy type See: _proxy_type

tcpNoDelay
bool tcpNoDelay [@property setter]

Set the tcp no-delay socket option on or off. See: nodelay

url
const(char)[] url [@property setter]

The URL to specify the location of the resource.

verbose
bool verbose [@property setter]

Set verbose. This will print request information to stderr.

Static functions

opCall
FTP opCall(const(char)[] url)

FTP access to the specified url.

opCall
FTP opCall()

Mixed In Members

From mixin Protocol

requestPause
alias requestPause = CurlReadFunc.pause

Value to return from onSend/onReceive delegates in order to pause a request

requestAbort
alias requestAbort = CurlReadFunc.abort

Value to return from onSend delegate in order to abort a request

handle
Curl handle [@property getter]

The curl handle used by this connection.

isStopped
bool isStopped [@property getter]

True if the instance is stopped. A stopped instance is not usable.

shutdown
void shutdown()

Stop and invalidate this instance.

verbose
bool verbose [@property setter]

Set verbose. This will print request information to stderr.

dataTimeout
Duration dataTimeout [@property setter]

Set timeout for activity on connection.

operationTimeout
Duration operationTimeout [@property setter]

Set maximum time an operation is allowed to take. This includes dns resolution, connecting, data transfer, etc.

connectTimeout
Duration connectTimeout [@property setter]

Set timeout for connecting.

proxy
const(char)[] proxy [@property setter]

Proxy See: _proxy

proxyPort
ushort proxyPort [@property setter]

Proxy port See: _proxy_port

CurlProxy
alias CurlProxy = RawCurlProxy

Type of proxy

proxyType
CurlProxy proxyType [@property setter]

Proxy type See: _proxy_type

dnsTimeout
Duration dnsTimeout [@property setter]

DNS lookup timeout.

netInterface
const(char)[] netInterface [@property setter]
const(ubyte)[4] netInterface [@property setter]
InternetAddress netInterface [@property setter]

The network interface to use in form of the IP of the interface.

localPort
ushort localPort [@property setter]

Set the local outgoing port to use.

setNoProxy
void setNoProxy(string hosts)

Set the no proxy flag for the specified host names.

localPortRange
ushort localPortRange [@property setter]

Set the local outgoing port range to use. This can be used together with the localPort property.

tcpNoDelay
bool tcpNoDelay [@property setter]

Set the tcp no-delay socket option on or off. See: nodelay

verifyPeer
bool verifyPeer [@property setter]

Sets whether SSL peer certificates should be verified. See: verifypeer

verifyHost
bool verifyHost [@property setter]

Sets whether the host within an SSL certificate should be verified. See: verifypeer

setAuthentication
void setAuthentication(const(char)[] username, const(char)[] password, const(char)[] domain)

Set the user name, password and optionally domain for authentication purposes.

setProxyAuthentication
void setProxyAuthentication(const(char)[] username, const(char)[] password)

Set the user name and password for proxy authentication.

onSend
size_t delegate(void[]) onSend [@property setter]

The event handler that gets called when data is needed for sending. The length of the void[] specifies the maximum number of bytes that can be sent.

onReceive
size_t delegate(ubyte[]) onReceive [@property setter]

The event handler that receives incoming data. Be sure to copy the incoming ubyte[] since it is not guaranteed to be valid after the callback returns.

onProgress
int delegate(size_t dlTotal, size_t dlNow, size_t ulTotal, size_t ulNow) onProgress [@property setter]

The event handler that gets called to inform of upload/download progress.

See Also

Meta