|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.network.QFtp
public class QFtp
The QFtp
class provides an implementation of the client side of FTP protocol. This class provides a direct interface to FTP that allows you to have more control over the requests. However, for new applications, it is recommended to use QNetworkAccessManager
and QNetworkReply
, as those classes possess a simpler, yet more powerful API.
The class works asynchronously, so there are no blocking functions. If an operation cannot be executed immediately, the function will still return straight away and the operation will be scheduled for later execution. The results of scheduled operations are reported via signals. This approach depends on the event loop being in operation.
The operations that can be scheduled (they are called "commands" in the rest of the documentation) are the following: connectToHost()
, login()
, close()
, list()
, cd()
, get()
, put()
, remove()
, mkdir()
, rmdir()
, rename()
and rawCommand()
.
All of these commands return a unique identifier that allows you to keep track of the command that is currently being executed. When the execution of a command starts, the commandStarted()
signal with the command's identifier is emitted. When the command is finished, the commandFinished()
signal is emitted with the command's identifier and a bool that indicates whether the command finished with an error.
In some cases, you might want to execute a sequence of commands, e.g. if you want to connect and login to a FTP server. This is simply achieved:
QFtp ftp = new QFtp(parent); ftp.connectToHost("ftp.trolltech.com"); ftp.login();In this case two FTP commands have been scheduled. When the last scheduled command has finished, a
done()
signal is emitted with a bool argument that tells you whether the sequence finished with an error. If an error occurs during the execution of one of the commands in a sequence of commands, all the pending commands (i.e. scheduled, but not yet executed commands) are cleared and no signals are emitted for them.
Some commands, e.g. list()
, emit additional signals to report their results.
Example: If you want to download the INSTALL file from Trolltech's FTP server, you would write this:
ftp.connectToHost("ftp.trolltech.com"); // id == 1 ftp.login(); // id == 2 ftp.cd("qt"); // id == 3 ftp.get("INSTALL"); // id == 4 ftp.close(); // id == 5For this example the following sequence of signals is emitted (with small variations, depending on network traffic, etc.):
start(1) stateChanged(HostLookup) stateChanged(Connecting) stateChanged(Connected) finished(1, false) start(2) stateChanged(LoggedIn) finished(2, false) start(3) finished(3, false) start(4) dataTransferProgress(0, 3798) dataTransferProgress(2896, 3798) readyRead() dataTransferProgress(3798, 3798) readyRead() finished(4, false) start(5) stateChanged(Closing) stateChanged(Unconnected) finished(5, false) done(false)The
dataTransferProgress()
signal in the above example is useful if you want to show a progress bar
to inform the user about the progress of the download. The readyRead()
signal tells you that there is data ready to be read. The amount of data can be queried then with the bytesAvailable()
function and it can be read with the read()
or readAll()
function. If the login fails for the above example, the signals would look like this:
start(1) stateChanged(HostLookup) stateChanged(Connecting) stateChanged(Connected) finished(1, false) start(2) finished(2, true) done(true)You can then get details about the error with the
error()
and errorString()
functions. For file transfer, QFtp
can use both active or passive mode, and it uses passive file transfer mode by default; see the documentation for setTransferMode()
for more details about this.
Call setProxy()
to make QFtp
connect via an FTP proxy server.
The functions currentId()
and currentCommand()
provide more information about the currently executing command.
The functions hasPendingCommands()
and clearPendingCommands()
allow you to query and clear the list of pending commands.
If you are an experienced network programmer and want to have complete control you can use rawCommand()
to execute arbitrary FTP commands.
Warning: The current version of QFtp
doesn't fully support non-Unix FTP servers.
QHttp
, QNetworkAccessManager
, QNetworkRequest
, QNetworkReply
, and FTP Example.
Nested Class Summary | |
---|---|
static class |
QFtp.Command
|
static class |
QFtp.Error
This enum specifies different error cases |
static class |
QFtp.State
This enum describes the state of a window. |
static class |
QFtp.TransferMode
FTP works with two socket connections; one for commands and another for transmitting data. |
static class |
QFtp.TransferType
This enum identifies the data transfer type used with get and put commands. |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal2 |
commandFinished
This signal takes 2 generic argument(s). |
QSignalEmitter.Signal1 |
commandStarted
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal2 |
dataTransferProgress
This signal takes 2 generic argument(s). |
QSignalEmitter.Signal1 |
done
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
listInfo
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal2 |
rawCommandReply
This signal takes 2 generic argument(s). |
QSignalEmitter.Signal0 |
readyRead
This signal is emitted in response to a get() command when there is new data to read. |
QSignalEmitter.Signal1 |
stateChanged
This signal takes 1 generic argument(s). |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QFtp()
Constructs a QFtp object with the given parent. |
|
QFtp(QObject parent)
Constructs a QFtp object with the given parent. |
Method Summary | |
---|---|
void |
abort()
Aborts the current command and deletes all scheduled commands. |
long |
bytesAvailable()
Returns the number of bytes that can be read from the data socket at the moment. |
int |
cd(java.lang.String dir)
Changes the working directory of the server to dir. |
void |
clearPendingCommands()
Deletes all pending commands from the list of scheduled commands. |
int |
close()
Closes the connection to the FTP server. |
int |
connectToHost(java.lang.String host)
Connects to the FTP server host using port port. |
int |
connectToHost(java.lang.String host,
char port)
Connects to the FTP server host using port port. |
QFtp.Command |
currentCommand()
Returns the command type of the FTP command being executed or None if there is no command being executed. |
QIODevice |
currentDevice()
Returns the QIODevice pointer that is used by the FTP command to read data from or store data to. |
int |
currentId()
Returns the identifier of the FTP command that is being executed or 0 if there is no command being executed. |
QFtp.Error |
error()
Returns the last error that occurred. |
java.lang.String |
errorString()
Returns a human-readable description of the last error that occurred. |
int |
get(java.lang.String file)
Downloads the file file from the server. |
int |
get(java.lang.String file,
QIODevice dev)
Downloads the file file from the server. |
int |
get(java.lang.String file,
QIODevice dev,
QFtp.TransferType type)
Downloads the file file from the server. |
boolean |
hasPendingCommands()
Returns true if there are any commands scheduled that have not yet been executed; otherwise returns false. |
int |
list()
Lists the contents of directory dir on the FTP server. |
int |
list(java.lang.String dir)
Lists the contents of directory dir on the FTP server. |
int |
login()
Logs in to the FTP server with the username user and the password password. |
int |
login(java.lang.String user)
Logs in to the FTP server with the username user and the password password. |
int |
login(java.lang.String user,
java.lang.String password)
Logs in to the FTP server with the username user and the password password. |
int |
mkdir(java.lang.String dir)
Creates a directory called dir on the server. |
int |
put(QByteArray data,
java.lang.String file)
Writes a copy of the given data to the file called file on the server. |
int |
put(QByteArray data,
java.lang.String file,
QFtp.TransferType type)
Writes a copy of the given data to the file called file on the server. |
int |
put(QIODevice dev,
java.lang.String file)
Reads the data from the IO device dev, and writes it to the file called file on the server. |
int |
put(QIODevice dev,
java.lang.String file,
QFtp.TransferType type)
Reads the data from the IO device dev, and writes it to the file called file on the server. |
int |
rawCommand(java.lang.String command)
Sends the raw FTP command command to the FTP server. |
int |
read(byte[] data)
Reads bytes from the stream into buffer. |
QByteArray |
readAll()
Reads all the bytes available from the data socket and returns them. |
int |
remove(java.lang.String file)
Deletes the file called file from the server. |
int |
rename(java.lang.String oldname,
java.lang.String newname)
Renames the file called oldname to newname on the server. |
int |
rmdir(java.lang.String dir)
Removes the directory called dir from the server. |
int |
setProxy(java.lang.String host,
char port)
Enables use of the FTP proxy on host host and port port. |
int |
setTransferMode(QFtp.TransferMode mode)
Sets the current FTP transfer mode to mode. |
QFtp.State |
state()
Returns the current state of the object. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal2 commandFinished
This signal takes 2 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: id), java.lang.Boolean(named: error)>:
This signal is emitted when processing the command identified by id has finished. error is true if an error occurred during the processing; otherwise error is false.
commandStarted()
, done()
, error()
, and errorString()
.
public final QSignalEmitter.Signal1 commandStarted
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: id)>:
This signal is emitted when processing the command identified by id starts.
commandFinished()
, and done()
.
public final QSignalEmitter.Signal2 dataTransferProgress
This signal takes 2 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Long(named: done), java.lang.Long(named: total)>:
This signal is emitted in response to a get()
or put()
request to indicate the current progress of the download or upload.
done is the amount of data that has already been transferred and total is the total amount of data to be read or written. It is possible that the QFtp
class is not able to determine the total amount of data that should be transferred, in which case total is 0. (If you connect this signal to a QProgressBar
, the progress bar shows a busy indicator if the total is 0).
Warning:done and total are not necessarily the size in bytes, since for large files these values might need to be "scaled" to avoid overflow.
get()
, put()
, and QProgressBar
.
public final QSignalEmitter.Signal1 done
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Boolean(named: error)>:
This signal is emitted when the last pending command has finished; (it is emitted after the last command's commandFinished()
signal). error is true if an error occurred during the processing; otherwise error is false.
commandFinished()
, error()
, and errorString()
.
public final QSignalEmitter.Signal1 listInfo
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.network.QUrlInfo(named: i)>:
This signal is emitted for each directory entry the list()
command finds. The details of the entry are stored in i.
list()
.
public final QSignalEmitter.Signal2 rawCommandReply
This signal takes 2 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: replyCode), java.lang.String(named: detail)>:
This signal is emitted in response to the rawCommand()
function. replyCode is the 3 digit reply code and detail is the text that follows the reply code.
rawCommand()
.
public final QSignalEmitter.Signal0 readyRead
get()
command when there is new data to read. If you specify a device as the second argument in the get()
command, this signal is not emitted; instead the data is written directly to the device.
You can read the data with the readAll()
or read()
functions.
This signal is useful if you want to process the data in chunks as soon as it becomes available. If you are only interested in the complete data, just connect to the commandFinished()
signal and read the data then instead.
get()
, read()
, readAll()
, and bytesAvailable()
.
public final QSignalEmitter.Signal1 stateChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: state)>:
This signal is emitted when the state of the connection changes. The argument state is the new state of the connection; it is one of the State
values.
It is usually emitted in response to a connectToHost()
or close()
command, but it can also be emitted "spontaneously", e.g. when the server closes the connection unexpectedly.
connectToHost()
, close()
, state()
, and State
.
Constructor Detail |
---|
public QFtp()
QFtp
object with the given parent.
public QFtp(QObject parent)
QFtp
object with the given parent.
Method Detail |
---|
public final void abort()
If there is an unfinished command (i.e. a command for which the commandStarted()
signal has been emitted, but for which the commandFinished()
signal has not been emitted), this function sends an ABORT command to the server. When the server replies that the command is aborted, the commandFinished()
signal with the error argument set to true is emitted for the command. Due to timing issues, it is possible that the command had already finished before the abort request reached the server, in which case, the commandFinished()
signal is emitted with the error argument set to false.
For all other commands that are affected by the abort()
, no signals are emitted.
If you don't start further FTP commands directly after the abort()
, there won't be any scheduled commands and the done()
signal is emitted.
Warning: Some FTP servers, for example the BSD FTP daemon (version 0.3), wrongly return a positive reply even when an abort has occurred. For these servers the commandFinished()
signal has its error flag set to false, even though the command did not complete successfully.
clearPendingCommands()
.
public final long bytesAvailable()
get()
, readyRead()
, read()
, and readAll()
.
public final int cd(java.lang.String dir)
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
commandStarted()
, and commandFinished()
.
public final void clearPendingCommands()
abort()
. hasPendingCommands()
, and abort()
.
public final int close()
The stateChanged()
signal is emitted when the state of the connecting process changes, e.g. to Closing, then Unconnected.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
stateChanged()
, commandStarted()
, and commandFinished()
.
public final int connectToHost(java.lang.String host)
The stateChanged()
signal is emitted when the state of the connecting process changes, e.g. to HostLookup, then Connecting, then Connected.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
stateChanged()
, commandStarted()
, and commandFinished()
.
public final int connectToHost(java.lang.String host, char port)
The stateChanged()
signal is emitted when the state of the connecting process changes, e.g. to HostLookup, then Connecting, then Connected.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
stateChanged()
, commandStarted()
, and commandFinished()
.
public final QFtp.Command currentCommand()
currentId()
.
public final QIODevice currentDevice()
QIODevice
pointer that is used by the FTP command to read data from or store data to. If there is no current FTP command being executed or if the command does not use an IO device, this function returns 0. This function can be used to delete the QIODevice
in the slot connected to the commandFinished()
signal.
get()
, and put()
.
public final int currentId()
currentCommand()
.
public final QFtp.Error error()
commandFinished()
or a done()
signal with the error argument set to true. If you start a new command, the error status is reset to NoError.
public final java.lang.String errorString()
commandFinished()
or a done()
signal with the error argument set to true. The error string is often (but not always) the reply from the server, so it is not always possible to translate the string. If the message comes from Qt, the string has already passed through tr().
public final int get(java.lang.String file, QIODevice dev)
If dev is 0, then the readyRead()
signal is emitted when there is data available to read. You can then read the data with the read()
or readAll()
functions.
If dev is not 0, the data is written directly to the device dev. Make sure that the dev pointer is valid for the duration of the operation (it is safe to delete it when the commandFinished()
signal is emitted). In this case the readyRead()
signal is not emitted and you cannot read data with the read()
or readAll()
functions.
If you don't read the data immediately it becomes available, i.e. when the readyRead()
signal is emitted, it is still available until the next command is started.
For example, if you want to present the data to the user as soon as there is something available, connect to the readyRead()
signal and read the data immediately. On the other hand, if you only want to work with the complete data, you can connect to the commandFinished()
signal and read the data when the get()
command is finished.
The data is transferred as Binary or Ascii depending on the value of type.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
readyRead()
, dataTransferProgress()
, and commandStarted()
.
public final int get(java.lang.String file)
If dev is 0, then the readyRead()
signal is emitted when there is data available to read. You can then read the data with the read()
or readAll()
functions.
If dev is not 0, the data is written directly to the device dev. Make sure that the dev pointer is valid for the duration of the operation (it is safe to delete it when the commandFinished()
signal is emitted). In this case the readyRead()
signal is not emitted and you cannot read data with the read()
or readAll()
functions.
If you don't read the data immediately it becomes available, i.e. when the readyRead()
signal is emitted, it is still available until the next command is started.
For example, if you want to present the data to the user as soon as there is something available, connect to the readyRead()
signal and read the data immediately. On the other hand, if you only want to work with the complete data, you can connect to the commandFinished()
signal and read the data when the get()
command is finished.
The data is transferred as Binary or Ascii depending on the value of type.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
readyRead()
, dataTransferProgress()
, and commandStarted()
.
public final int get(java.lang.String file, QIODevice dev, QFtp.TransferType type)
If dev is 0, then the readyRead()
signal is emitted when there is data available to read. You can then read the data with the read()
or readAll()
functions.
If dev is not 0, the data is written directly to the device dev. Make sure that the dev pointer is valid for the duration of the operation (it is safe to delete it when the commandFinished()
signal is emitted). In this case the readyRead()
signal is not emitted and you cannot read data with the read()
or readAll()
functions.
If you don't read the data immediately it becomes available, i.e. when the readyRead()
signal is emitted, it is still available until the next command is started.
For example, if you want to present the data to the user as soon as there is something available, connect to the readyRead()
signal and read the data immediately. On the other hand, if you only want to work with the complete data, you can connect to the commandFinished()
signal and read the data when the get()
command is finished.
The data is transferred as Binary or Ascii depending on the value of type.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
readyRead()
, dataTransferProgress()
, and commandStarted()
.
public final boolean hasPendingCommands()
The command that is being executed is not considered as a scheduled command.
clearPendingCommands()
, currentId()
, and currentCommand()
.
public final int list()
The listInfo()
signal is emitted for each directory entry found.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
listInfo()
, commandStarted()
, and commandFinished()
.
public final int list(java.lang.String dir)
The listInfo()
signal is emitted for each directory entry found.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
listInfo()
, commandStarted()
, and commandFinished()
.
public final int login(java.lang.String user)
The stateChanged()
signal is emitted when the state of the connecting process changes, e.g. to LoggedIn.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
commandStarted()
, and commandFinished()
.
public final int login()
The stateChanged()
signal is emitted when the state of the connecting process changes, e.g. to LoggedIn.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
commandStarted()
, and commandFinished()
.
public final int login(java.lang.String user, java.lang.String password)
The stateChanged()
signal is emitted when the state of the connecting process changes, e.g. to LoggedIn.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
commandStarted()
, and commandFinished()
.
public final int mkdir(java.lang.String dir)
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
commandStarted()
, and commandFinished()
.
public final int put(QIODevice dev, java.lang.String file)
The data is transferred as Binary or Ascii depending on the value of type.
Make sure that the dev pointer is valid for the duration of the operation (it is safe to delete it when the commandFinished()
is emitted).
public final int put(QIODevice dev, java.lang.String file, QFtp.TransferType type)
The data is transferred as Binary or Ascii depending on the value of type.
Make sure that the dev pointer is valid for the duration of the operation (it is safe to delete it when the commandFinished()
is emitted).
public final int put(QByteArray data, java.lang.String file)
dataTransferProgress()
signal. The data is transferred as Binary or Ascii depending on the value of type.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
Since this function takes a copy of the data, you can discard your own copy when this function returns.
dataTransferProgress()
, commandStarted()
, and commandFinished()
.
public final int put(QByteArray data, java.lang.String file, QFtp.TransferType type)
dataTransferProgress()
signal. The data is transferred as Binary or Ascii depending on the value of type.
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
Since this function takes a copy of the data, you can discard your own copy when this function returns.
dataTransferProgress()
, commandStarted()
, and commandFinished()
.
public final int rawCommand(java.lang.String command)
QFtp
function, we recommend using the function instead of raw FTP commands since the functions are easier and safer. The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
rawCommandReply()
, commandStarted()
, and commandFinished()
.
public final QByteArray readAll()
get()
, readyRead()
, bytesAvailable()
, and read()
.
public final int remove(java.lang.String file)
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
commandStarted()
, and commandFinished()
.
public final int rename(java.lang.String oldname, java.lang.String newname)
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
commandStarted()
, and commandFinished()
.
public final int rmdir(java.lang.String dir)
The function does not block and returns immediately. The command is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by commandStarted()
and commandFinished()
.
When the command is started the commandStarted()
signal is emitted. When it is finished the commandFinished()
signal is emitted.
commandStarted()
, and commandFinished()
.
public final int setProxy(java.lang.String host, char port)
QFtp
does not support FTP-over-HTTP proxy servers. Use QHttp
for this.
public final int setTransferMode(QFtp.TransferMode mode)
QFtp::Passive
. QFtp::TransferMode
.
public final QFtp.State state()
stateChanged()
signal is emitted. State
, and stateChanged()
.
public final int read(byte[] data)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |