|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.biffle.cliff.pearl.tools.Client
Implements a simple command-line interface to a PearlConnection, primarily to demonstrate the use of the APIs and exception cases.
| Field Summary | |
protected PearlConnection |
con
Our connection to the device. |
protected DeviceInfo |
info
Cached copy of the device's info (created lazily). |
protected DeviceSettings |
settings
Cached copy of the device's settings (created lazily). |
| Constructor Summary | |
Client(java.net.InetAddress device)
Creates a new Client, connecting to a Pearl device via TCP. |
|
| Method Summary | |
void |
authenticate(java.lang.String password)
Attempts to authenticate the connection using the provided password. |
void |
close()
Closes the connection. |
void |
delete(java.lang.String fidS)
Attempts to delete a file by FID. |
protected void |
downloadInfo()
Caches device info. |
protected void |
downloadSettings()
Caches device settings. |
void |
dump(java.lang.String fidS)
Dumps the first 16k of a file. |
void |
fetch(java.lang.String fidS)
Retrieves a file to local storage. |
static void |
main(java.lang.String[] args)
Main function executed from the command line; takes one argument (an IP address) and spawns a Client. |
protected void |
msg(java.lang.String message)
Utility function; prints a message from the Client (rather than data from the device). |
void |
run()
The meat of the client; this function is executed in its own thread and provides the console interface. |
void |
showField(java.lang.String field)
Displays a named field from the device settings file. |
void |
showFile(java.lang.String arg)
Show file information. |
void |
showInfo(java.lang.String arg)
Show system information. |
void |
showList(java.lang.String arg)
Show list of available files. |
void |
showStorage(java.lang.String indexString)
Displays information on a storage device by index, or a list of storage devices if no index is given. |
void |
taxi(java.lang.String filename)
Uploads a local taxi file. |
void |
unmarkBad(java.lang.String fidS)
Attempts to un-mark a file as bad. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected PearlConnection con
protected DeviceSettings settings
protected DeviceInfo info
| Constructor Detail |
public Client(java.net.InetAddress device)
throws java.io.IOException,
PearlException
| Method Detail |
public void showField(java.lang.String field)
public void showStorage(java.lang.String indexString)
public void showList(java.lang.String arg)
public void showInfo(java.lang.String arg)
public void showFile(java.lang.String arg)
public void authenticate(java.lang.String password)
public void delete(java.lang.String fidS)
public void dump(java.lang.String fidS)
public void taxi(java.lang.String filename)
public void fetch(java.lang.String fidS)
public void unmarkBad(java.lang.String fidS)
protected void downloadSettings()
throws PearlException
PearlException
protected void downloadInfo()
throws PearlException
PearlExceptionpublic void close()
public void run()
run in interface java.lang.Runnableprotected void msg(java.lang.String message)
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||