|
|||||||||
| 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.JFtpControl
The JFtpControl class implements an FTP control thread. Depending on the chosen threading model, at any moment there can be zero, one or any number of control threads running simultaneously. All control threads are owned by the JFtp instance. A control thread may own JFtpData threads.
JFtp,
JFtpData,
JFtpResponse| Nested Class Summary | |
(package private) class |
JFtpControl.ControlQueueItem
Class for describing a JFtpControl's queue. |
(package private) class |
JFtpControl.IdleTask
A TimerTask to watch inactivity on a JFtpControlThread. |
| Nested classes inherited from class ip1.ex14.JFtpThread |
|
| Field Summary | |
private java.io.BufferedReader |
in
|
protected java.io.File |
localDir
The local working directory. |
private java.io.PrintWriter |
out
|
protected boolean |
passive
Are we in passive mode? |
protected java.net.URL |
remoteUrl
The remote working URL. |
protected java.net.Socket |
sockControl
Control connection. |
static int |
STATE_CONNECT
We are connected . |
static int |
STATE_LOGGED
We have logged in. |
| 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 | |
JFtpControl(JFtp jftp,
java.net.URL url)
The constructor. |
|
| Method Summary | |
(package private) void |
die_command(java.lang.String cmd)
The command issued is not allowed in current state. |
private void |
makeCwd(JFtpEntry entry)
Change the remote working directory. |
private void |
makeDele(JFtpEntry entry)
Delete a remote file. |
private JFtpResponse |
makeList()
Returns the directory listing. |
private JFtpResponse |
makeNoop()
Send a NOOP command. |
private JFtpResponse |
makePass()
Sent the user's password. |
private JFtpResponse |
makePwd()
Prints current working directory. |
private void |
makeQuit()
Says goodbye to the FTP server. |
private void |
makeRetr(JFtpEntry entry)
Retrieve a remote file. |
private void |
makeStor(JFtpEntry entry)
Send a file to the server. |
private boolean |
makeType(java.lang.String type)
Set the transfer type. |
private JFtpResponse |
makeUser()
Authenticate. |
void |
queueCwd(JFtpEntry entry)
Queue a CWD command. |
void |
queueDele(JFtpEntry entry)
Queue a DELE command. |
void |
queueList()
Queue a LIST command. |
void |
queueNoop()
Queue a NOOP command. |
void |
queuePwd()
Queue a PWD command. |
void |
queueRetr(JFtpEntry entry)
Queue a RETR command. |
void |
queueStor(JFtpEntry entry)
Queue a STOR command. |
protected JFtpResponse |
recvResponse()
Receive and process a reponse from the server. |
void |
run()
The thread's entry point. |
protected void |
sendCommand(java.lang.String strng)
Sends a string to the remote host. |
protected void |
shutdown()
Close reader, writer and socket. |
| Methods inherited from class ip1.ex14.JFtpThread |
addChild, addQueue, debug, dumpQueue, getChild, getRoot, isBusy, peekQueue, propagateTreeChange, queueShutdown, readQueue, refreshNode, refreshThreadView, removeChild, reset, toString, 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.net.Socket sockControl
public static final int STATE_CONNECT
public static final int STATE_LOGGED
protected java.io.File localDir
protected java.net.URL remoteUrl
protected boolean passive
private java.io.BufferedReader in
private java.io.PrintWriter out
| Constructor Detail |
public JFtpControl(JFtp jftp,
java.net.URL url)
jftp - the JFtp paren threadurl - the starting URL| Method Detail |
void die_command(java.lang.String cmd)
cmd - the rejected commandpublic void run()
run in interface java.lang.Runnablerun in class JFtpThreadprotected JFtpResponse recvResponse()
sendCommand(java.lang.String),
JFtpResponseprotected void sendCommand(java.lang.String strng)
strng - the string to sendrecvResponse()protected void shutdown()
shutdown in class JFtpThreadprivate void makeCwd(JFtpEntry entry)
queueCwd(ip1.ex14.JFtpEntry)private void makeDele(JFtpEntry entry)
queueDele(ip1.ex14.JFtpEntry)private JFtpResponse makeList()
queueList(),
JFtpData.queueReadStr(java.lang.StringBuffer),
JFtp.dispRemote(java.util.Vector)private JFtpResponse makeNoop()
queueNoop(),
JFtpControl.IdleTaskprivate JFtpResponse makePass()
private JFtpResponse makePwd()
queuePwd()private void makeRetr(JFtpEntry entry)
entry - the file we are retrievingmakeType(java.lang.String),
queueRetr(ip1.ex14.JFtpEntry),
recvResponse(),
sendCommand(java.lang.String),
JFtpData.queueReceive(java.io.File)private void makeStor(JFtpEntry entry)
makeType(java.lang.String),
queueStor(ip1.ex14.JFtpEntry),
recvResponse(),
sendCommand(java.lang.String),
JFtpData.queueSend(java.io.File)private boolean makeType(java.lang.String type)
type - the transfer typemakeRetr(ip1.ex14.JFtpEntry),
makeStor(ip1.ex14.JFtpEntry),
sendCommand(java.lang.String),
recvResponse()private void makeQuit()
sendCommand(java.lang.String),
recvResponse()private JFtpResponse makeUser()
makePass()public void queueCwd(JFtpEntry entry)
makeCwd(ip1.ex14.JFtpEntry)public void queueDele(JFtpEntry entry)
makeDele(ip1.ex14.JFtpEntry),
JFtpWindow.actionPerformed(java.awt.event.ActionEvent)public void queueList()
makeList()public void queueNoop()
makeNoop()public void queuePwd()
makePwd()public void queueRetr(JFtpEntry entry)
makeRetr(ip1.ex14.JFtpEntry)public void queueStor(JFtpEntry entry)
makeStor(ip1.ex14.JFtpEntry)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||