Kenneth,
I had done something similar(connecting to MQ, getting a bunch of queue
info and displaying to the user as a dir structure).But the ftpserver
codebase I used was 2+ years old. So really don't know if this will
still hold good. This is what I did:
- Modified the execute() method in LIST.java file by adding
ftpletContainer.onLIST()
- Override onLIST() on my ftplet to have
I did something line this in LIST.java:
public void execute(Connection connection,
FtpRequest request,
FtpSessionImpl session,
FtpReplyOutput out) throws IOException,
FtpException {
try {
// reset state variables
session.resetState();
FtpServerContext serverContext =
connection.getServerContext();
Ftplet ftpletContainer = serverContext.getFtpletContainer();
FtpletEnum ftpletRet;
try{
ftpletRet = ftpletContainer.onLIST(session, request,
out);
} catch(Exception e) {
LOG.debug("Ftplet container threw exception", e);
ftpletRet = FtpletEnum.RET_DISCONNECT;
}
if(ftpletRet == FtpletEnum.RET_SKIP) {
return;
}else
if(ftpletRet == FtpletEnum.RET_DISCONNECT) {
serverContext.getConnectionManager().closeConnection(connection);
return;
}
}
Good Luck!
Ajith
-----Original Message-----
From: Kenneth Vanvik Hansen [mailto:[email protected]]
Sent: Wednesday, March 17, 2010 9:39 AM
To: [email protected]
Subject: LIST from database
Hi, i have written an ftplet that puts a file and file info in a
database table. Now I need to get LIST to list information from the
database. I was wondering if something like this has been done before?
Would save me some time if someone had any solutions/ideas.
Kenneth