Sorry, it is in Clojure so that is the source. =) Thank you for looking. On Wed, Aug 12, 2009 at 12:36 PM, Sai Pullabhotla < [email protected]> wrote:
> I'm not sure how to read the code you have sent (the clj) :). May be > some one else can. Do you happen to have the Java source for your > Ftplet? > > Sai Pullabhotla > www.jMethods.com > > > > > On Wed, Aug 12, 2009 at 11:31 AM, Carl > Youngblood<[email protected]> wrote: > > Ya'll, > > Really sorry about this, but I wasn't subscribed when I started my last > > thread and I can't figure out how to reply to it. Thus, this new thread, > my > > bad. > > > > Below is my ftplet source code that Sai asked for. Below it I've also > > included the previous message. > > > > ftplet.clj > > > > (ns ftp.ftplet > > (:import (org.apache.ftpserver.ftplet FtpletResult) > > (org.apache.ftpserver.ftplet FtpReply DefaultFtpReply)) > > (:gen-class > > :extends org.apache.ftpserver.ftplet.DefaultFtplet)) > > > > (defn reply [code string session] > > (.write session (new DefaultFtpReply > > code > > string))) > > > > (defn pass [session] > > (reply FtpReply/REPLY_230_USER_LOGGED_IN > > "Free logins for all!" > > session) > > FtpletResult/SKIP) > > > > (defn pwd [session] > > (reply 257 > > "/" > > session)) > > > > (defn -init [this context]) > > > > (defn -destroy [this]) > > > > (defn -beforeCommand [this session request] > > (let [command (.. request getCommand toUpperCase) > > pass-command (.equals "PASS" command) > > pwd-command (.equals "PWD" command)] > > (println command) > > (cond > > pass-command (pass session) > > pwd-command (pwd session)))) > > > > (defn -onMkdirStart [this session request] > > (let [command (.. request getCommand toUpperCase)] > > (println command))) > > > > > > Original post: > > > > On Tue, Aug 11, 2009 at 10:05 PM, Carl > > Youngblood<[email protected]> wrote: > >> Hey All, > >> In my ftplet, in my beforeCommand handler I print out the > >> request.getCommand(). > >> > >> The following login are my ftp commands and responses: > >> 220 Service ready for new user. > >> USER anonymous > >> 331 Guest login okay, send your complete e-mail address as password. > >> PASS ************** > >> 230 Free logins for all! > >> Connected > >> Retrieving directory listing... > >> PWD > >> 530 Access denied. > >> > >> > >> My println of command in beforeCommand generates the following > >> USER > >> PASS > >> > >> > >> My problem is that it should also be printing PWD. What am I missing > that > >> explains why PWD is not getting caught in beforeCommand? > >> > >> Thanks! > >> Carl > > > > > > > > Thanks for the help! > > Carl > > >
