|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--ip1.ex14.JFtpThread
|
+--ip1.ex14.JFtpData
The JFtpData class implements an FTP data thread. It supports both active and passive data connections. A data thread is owned by a JFtpControl thread.
JFtpControl| Nested Class Summary | |
(package private) class |
JFtpData.DataQueueItem
Describes an item of a JFTpData's queue. |
| Nested classes inherited from class ip1.ex14.JFtpThread |
|
| Field Summary | |
(package private) char[] |
charBuffer
Character buffer for file transfers. |
(package private) static int |
charBufferSize
Size of the buffer for file transfers. |
(package private) boolean |
passive
Are we in passive mode? |
protected long |
progress
The progress indicator. |
protected java.lang.StringBuffer |
sb
String buffer. |
protected java.net.Socket |
sock
The data socket |
protected java.net.InetSocketAddress |
sockAddr
Where to connect to (for passive mode) |
protected java.net.ServerSocket |
sockListen
Listening socket (for active mode) |
static int |
STATE_CONNECTED
We have a connection. |
static int |
STATE_CONNECTING
We are attempting to connect (initial state). |
protected long |
targetSize
The target size. |
| Fields inherited from class ip1.ex14.JFtpThread |
children, counter, id, node, parent, queue, state, STATE_EXITED, STATE_NOTRUNNING, STATE_SHUTDOWN, threadTree, threadTreeChanged, type |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
(package private) |
JFtpData(JFtpControl parent)
The constructor. |
(package private) |
JFtpData(JFtpControl parent,
long targetSize)
Variant of the constructor. |
| Method Summary | |
void |
queueReadStr(java.lang.StringBuffer sb)
Queue reading to a StringBuffer. |
void |
queueReceive(java.io.File file)
Queue receiving a file from the server. |
void |
queueSend(java.io.File file)
Queue sending a local file to the server. |
void |
run()
Establish the data connection. |
java.lang.String |
toString()
String representation. |
| Methods inherited from class ip1.ex14.JFtpThread |
addChild, addQueue, debug, dumpQueue, getChild, getRoot, isBusy, peekQueue, propagateTreeChange, queueShutdown, readQueue, refreshNode, refreshThreadView, removeChild, reset, shutdown, waitShutdown |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.StringBuffer sb
protected java.net.Socket sock
protected java.net.ServerSocket sockListen
protected java.net.InetSocketAddress sockAddr
protected long progress
protected long targetSize
public static final int STATE_CONNECTING
public static final int STATE_CONNECTED
boolean passive
static final int charBufferSize
char[] charBuffer
| Constructor Detail |
JFtpData(JFtpControl parent,
long targetSize)
throws java.io.IOException
JFtpData(JFtpControl parent) throws java.io.IOException
| Method Detail |
public void queueReceive(java.io.File file)
file - the file we output to.public void queueReadStr(java.lang.StringBuffer sb)
sb - the StringBuffer to output to.JFtpControl.makeList()public void queueSend(java.io.File file)
public void run()
run in interface java.lang.Runnablerun in class JFtpThreadpublic java.lang.String toString()
toString in class JFtpThread
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||