How to truly embed FTPServer in application?

2013-07-18 Thread David Hoffer
I'd like to use FTPServer in an embedded application.  The instructions
show how to do this but the example is not quite as embedded as I'd like.

In my use case I want to receive FTPS files but I don't really want the
file to be stored on disk, rather I want to be notified of the new message
event in Java code and then I want to get and consume the message data
directly by my application.  I.e. I don't want to have to poll the disk
looking for new data/etc.

Ideally it would all be stream based as the files can be large but I'd be
satisfied to start with getting the data in any form...but I need to be
notified when it has arrived and have a way to get the data...even if just
a byte [].

How can I do this?

Thanks,
-Dave


Re: How to truly embed FTPServer in application?

2013-07-18 Thread Thomaz Luiz Santos
use the Ftplet and capture the command STOR ( Transfer complete ).



On Thu, Jul 18, 2013 at 4:58 PM, David Hoffer dhoff...@gmail.com wrote:

 I'd like to use FTPServer in an embedded application.  The instructions
 show how to do this but the example is not quite as embedded as I'd like.

 In my use case I want to receive FTPS files but I don't really want the
 file to be stored on disk, rather I want to be notified of the new message
 event in Java code and then I want to get and consume the message data
 directly by my application.  I.e. I don't want to have to poll the disk
 looking for new data/etc.

 Ideally it would all be stream based as the files can be large but I'd be
 satisfied to start with getting the data in any form...but I need to be
 notified when it has arrived and have a way to get the data...even if just
 a byte [].

 How can I do this?

 Thanks,
 -Dave




-- 
--
Thomaz Luiz Santos
Linux User: #359356
http://thomaz.santos.googlepages.com/


Re: How to truly embed FTPServer in application?

2013-07-18 Thread David Hoffer
Not sure how to do that...  Do you mean extend DefaultFtpletContainer and
override afterCommand()?  Then it it do something like...

String command = request.getCommand().toUpperCase();
if (STOR.equals(command)) {
   // data transfer is complete, get the data.  How?
}

How can I get the data/file that was just transferred?  I don't see data
methods on the Ftplet.

I've not used this component before, any examples or pointers are greatly
appreciated.

-Dave


On Thu, Jul 18, 2013 at 2:16 PM, Thomaz Luiz Santos thomaz.san...@gmail.com
 wrote:

 use the Ftplet and capture the command STOR ( Transfer complete ).



 On Thu, Jul 18, 2013 at 4:58 PM, David Hoffer dhoff...@gmail.com wrote:

  I'd like to use FTPServer in an embedded application.  The instructions
  show how to do this but the example is not quite as embedded as I'd like.
 
  In my use case I want to receive FTPS files but I don't really want the
  file to be stored on disk, rather I want to be notified of the new
 message
  event in Java code and then I want to get and consume the message data
  directly by my application.  I.e. I don't want to have to poll the disk
  looking for new data/etc.
 
  Ideally it would all be stream based as the files can be large but I'd be
  satisfied to start with getting the data in any form...but I need to be
  notified when it has arrived and have a way to get the data...even if
 just
  a byte [].
 
  How can I do this?
 
  Thanks,
  -Dave
 



 --
 --
 Thomaz Luiz Santos
 Linux User: #359356
 http://thomaz.santos.googlepages.com/