|
FTP-Server API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--server.commands.AbstractCommand
This is the superclass of ANY command! It formes the Chain-of-Responsibillity. The class MUST have the name of the FTP - command in order to work! Fx. is the command cwd handled by the class Cwd.class.
Field Summary | |
protected Command |
command
|
protected String |
name
|
protected String |
originalOrder
|
protected Session |
ses
|
Constructor Summary | |
AbstractCommand()
|
Method Summary | |
void |
action(String originalOrder)
Sends the Clients order to the Object. |
void |
addCommandLast(AbstractCommand command)
Adds a command as the second last commmand. |
void |
build(Session ses,
Command command)
Is used to build up the chain. |
protected abstract void |
carryOut(String order)
This method holds the implementation for the command. |
AbstractCommand |
clone(Session ses,
Command com)
|
int |
compareTo(Object o1)
|
protected int |
countUp()
|
boolean |
equals(Object o)
|
protected String |
fileToSystem(File f)
Takes a file, and prints it in the correct way (Windows vs Unix) |
protected File |
makeFileOfOrder(String order)
Makes a file of an order. |
void |
save()
|
AbstractCommand |
sort()
|
protected void |
start()
Empty method that can be overridden, and is called at instantiation time. |
String |
toString()
Prints a comma seperated list of the the names in the Chain-of-responsibillity, from this AbstactCommand and forward. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Command command
protected Session ses
protected String name
protected String originalOrder
Constructor Detail |
public AbstractCommand()
Method Detail |
protected abstract void carryOut(String order)
order
- the order, except the first word.public final void save()
public final AbstractCommand clone(Session ses, Command com)
public final void action(String originalOrder)
originalOrder
- client order (fx. cwd)protected int countUp() throws NullPointerException
NullPointerException
public final AbstractCommand sort()
public boolean equals(Object o)
equals
in class Object
public int compareTo(Object o1)
compareTo
in interface Comparable
protected void start()
public final void build(Session ses, Command command)
ses
- the session that this chain representscommand
- the command object, that is used to communicate with the client.public final void addCommandLast(AbstractCommand command)
command
- the new AbstractCommand to add to the chainprotected File makeFileOfOrder(String order)
order
- a filename (example.txt)
protected String fileToSystem(File f)
f
- File
public String toString()
toString
in class Object
|
FTP-Server API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |