Best practice for sending FTP replies from an ftplet

2010-11-23 Thread John Hartnup
Hi, I can't find any examples (maybe not looking hard enough) - but how do I send the user localised text from an ftplet? session.write(LocalizedFtpReply.translate(session, request, context, FtpReply.REPLY_550_REQUESTED_ACTION_NOT_TAKEN, PASS, null)); ... is what is used in other parts of the

Re: Best practice for sending FTP replies from an ftplet

2010-11-23 Thread John Hartnup
On 23 November 2010 16:38, Niklas Gustavsson nik...@protocol7.com wrote: On Tue, Nov 23, 2010 at 5:11 PM, John Hartnup john.hart...@gmail.com wrote: I can't find any examples (maybe not looking hard enough) - but how do I send the user localised text from an ftplet? In the current version

Re: FTP server active / passive mode

2010-11-25 Thread John Hartnup
On 25 November 2010 10:49, Aidan Diffey aidan.dif...@gmail.com wrote: Okay.. Now I am stumped. How do I create a custom FTPLet that implements the onDownloadStart method in PASSIVE mode? Reading both your posts, I think you're confused about what onDownloadStart() does. As far as I

Re: FTP server active / passive mode

2010-11-25 Thread John Hartnup
On 25 November 2010 11:18, Aidan Diffey aidan.dif...@gmail.com wrote: I have embedded the FTP server into a JBoss application. When the client issues a RETR command, I read a database and get a byte[] which I the transfer to the client. How can I transfer the data to the client with the

Re: FTP server active / passive mode

2010-11-25 Thread John Hartnup
On 25 November 2010 13:04, Aidan Diffey aidan.dif...@gmail.com wrote: I have been doing that with the documentation provided by the Apache FTP server. (https://mina.apache.org/ftpserver/ftplet.html). I am sending FTP reply codes at every stage. I have looked at the RETR command and looks

Re: FTP server active / passive mode

2010-11-26 Thread John Hartnup
On 26 November 2010 14:07, Aidan Diffey aidan.dif...@gmail.com wrote: Right. Given that a FileSystemView is created against an FTP session.. Can I get the Session from a FileSystemView. My implementation requires me to be able to get the IP address of the client that is performing the

Re: FTP server active / passive mode

2010-11-26 Thread John Hartnup
On 26 November 2010 14:14, Aidan Diffey aidan.dif...@gmail.com wrote: Could I do it in the afterCommand on the PASS command? Seems like a good option. -- There is no way to peace; peace is the way

No common ciphersuite

2011-01-26 Thread John Hartnup
I'm running ftpserver on J2SE 1.5 on Windows, and trying to connect to it using the ftp-ssl client on Debian Linux. On the server side I have: ssl protocol=TLS client-authentication=NONE keystore file=test.jks password=password / /ssl On the client side I have: ftp -z certrequired -z cipher-ALL

Re: No common ciphersuite

2011-01-27 Thread John Hartnup
deep down in the bowels of java ssl which was swallowed with being logged. Once i saw what that exception was it was immediately obvious what i had done wrong. I eventually found the problem with java debugging stepping through the ssl initialisation. On 27/01/11 11:47, John Hartnup wrote

Per-listener ftplets/usermanagers/filesystems

2011-01-27 Thread John Hartnup
Is it possible to configure ftpserver such that one listener has different ftplets/usermanager/filesystems from another? It's not obvious to me from the configuration docs. Thanks, John -- There is no way to peace; peace is the way

Re: Force users to issue an AUTH command in explicit FTPS ?

2011-10-03 Thread John Hartnup
I use this in an ftplet -- much the same approach as David's but actually tested! Notes: - consultArbiter() checks the client certificate against some criteria. You can omit this, or roll your own. - I have my own logger. You can remove those lines, or replace them with calls to your preferred

Re: AUTH TLS vs AUTH SSL

2011-10-03 Thread John Hartnup
Further to this, judging by the IETF draft, AUTH TLS-C should be accepted as a synonym for AUTH TLS. By inference, judging by some emails on this list a few months ago, AUTH TLS-P should be accepted as a synonym for AUTH SSL. On 3 October 2011 12:21, John Hartnup john.hart...@gmail.com wrote

Re: Enabling sftp in Apache Ftpserver

2012-07-15 Thread John Hartnup
Sftp and Ftps are completely different protocols. It just doesn't make sense to put both in the same server. It would be pretty neat if Apache's java servers shared common file system / file classes. I'm not sure what the barriers to this are. On Jul 15, 2012 11:16 AM, Sam Mizanin

Re: GnuTLS internal error in Filezilla

2012-09-17 Thread John Hartnup
It looks to me like a firewall blocking the data connection. Some firewalls deal with FTP by snooping on the control connection, and opening the appropriate ports when it sees a PORT or PASV command/response. If the control connection is secured with SSL, the firewall can't see PORT/PASV, so it

Re: GnuTLS internal error in Filezilla

2012-09-17 Thread John Hartnup
Something happens in between the two log lines. -Original Message- From: John Hartnup [mailto:john.hart...@gmail.com] Sent: Monday, September 17, 2012 3:42 PM To: ftpserver-users@mina.apache.org Subject: Re: GnuTLS internal error in Filezilla It looks to me like a firewall blocking

Re: How to set the Default Transfer Mode to BINARY

2012-10-09 Thread John Hartnup
It can't be done, at least not without redefining the protocol and modifying both client and server. Both ends need to agree on transfer type, and the client will default to ASCII. On Oct 9, 2012 11:04 PM, Shannonhouse, Joseph G (IS) joe.shannonho...@ngc.com wrote: I am running an embedded FTP

Re: Using FtpServer to transparently encipher files

2013-03-08 Thread John Hartnup
You can create your own implementations of FtpFile, FilesystemView and FilesystemFactory. You typically need all three - a FilesystemFactory provides a way to create FilesystemViews, and a FilesystemView produces FtpFiles. FtpServerFactory has a setFilesystem() method, so you can inject your

Re: Using FtpServer to transparently encipher files

2013-03-08 Thread John Hartnup
... using Spring. On 8 March 2013 10:59, John Hartnup john.hart...@gmail.com wrote: You can create your own implementations of FtpFile, FilesystemView and FilesystemFactory. You typically need all three - a FilesystemFactory provides a way to create FilesystemViews, and a FilesystemView

Re: No users can connect, no error.

2013-05-22 Thread John Hartnup
Hartnup ---05/21/2013 01:02:22 PM---This like the work of a firewall rejecting anonymous Ftp. Yo]John Hartnup ---05/21/2013 01:02:22 PM---This like the work of a firewall rejecting anonymous Ftp. You could verify this by trying to log in From: John Hartnup john.hart...@gmail.com To: ftpserver-users

Re: how can get file downloading progress?

2013-06-19 Thread John Hartnup
Look at the ftplet interface. https://cwiki.apache.org/FTPSERVER/ftplet.html Specifically the onDownloadEnd() method. On 19 June 2013 12:02, Nick Yang yr.n...@gmail.com wrote: hello everyone, I want to design a monitor for the ftpserver. How can i get the downloading progress when the client

Re: How to truly embed FTPServer in application?

2013-07-19 Thread John Hartnup
To do something different instead of writing native files, you need to write your own implementations of FtpFilesystemFactory, FtpFile and FilesystemView. Use NativeFtpFile etc. as guides. Then, when wiring up your embedded server, server.setFilesystemFactory(myFilesystemFactory); ftplets may

Re: How to truly embed FTPServer in application?

2013-07-19 Thread John Hartnup
the full file path so I can retrieve it from the native file system? I'm not clear how to use the Ftplet to accomplish this as Thomaz suggested. -Dave On Fri, Jul 19, 2013 at 2:47 AM, John Hartnup john.hart...@gmail.com wrote: To do something different instead of writing native files, you need

Re: Help embedding into Android

2013-09-10 Thread John Hartnup
I don't know a great deal about Android, but in principle you shouldn't need to do anything different from standard Java. I suggest you attach a debugger to your Android app and put a breakpoint at server.start(). Either the breakpoint won't trigger, meaning you need to find out why your code

Re: Apache FtpServer doubts

2013-09-16 Thread John Hartnup
. -Dave On Mon, Sep 16, 2013 at 6:33 AM, John Hartnup john.hart...@gmail.com wrote: Write your own implementations of FtpFile, FileSystemView, FileSystemFactory. Inject the FileSystemFactory into your FtpServer object. That's it. On 16 September 2013 13:29, David Hoffer dhoff

Re: directory structure permissions account locking

2013-10-16 Thread John Hartnup
The answer to any question like this is to customise the Filesystem classes to do what you want. I've attached some Java files (not warrantied for any particular purpose) for DelegatingFilesystem -- you can use one of these as the top of your filesystem hierarchy, with real, separately

Re: directory structure permissions account locking

2013-10-16 Thread John Hartnup
the interfaces you suggest. I did not get any attached files though. Genti From: John Hartnup [mailto:john.hart...@gmail.com] Sent: Wednesday, October 16, 2013 9:58 AM To: ftpserver-users@mina.apache.org Subject: Re: directory structure permissions account locking The answer to any question like

Re: directory structure permissions account locking

2013-10-24 Thread John Hartnup
To: ftpserver-users@mina.apache.org Subject: RE: directory structure permissions account locking That's great. All I was looking for was a way to approach the problem . You've provided even more Thank you very much, Genti -Original Message- From: John Hartnup [mailto:john.hart

Re: Customizing ls command

2014-01-21 Thread John Hartnup
You need to write your own Filesystem implementation. This has been discussed a few times in this mailing list, so take a look at the archives. On 21 January 2014 10:37, Andreas Mueller a...@iit.de wrote: Hi, I want to use FTP Server on my proprietary data which is not a directory with

Re: disable sslv3

2015-01-22 Thread John Hartnup
I've gone ahead and attached your patch to the JIRA bug. On Thu Jan 22 2015 at 12:02:37 John Hartnup john.hart...@gmail.com wrote: Actually there is already a bug record: https://issues.apache.org/jira/browse/FTPSERVER-459 On Thu Jan 22 2015 at 12:00:19 John Hartnup john.hart...@gmail.com

Re: disable sslv3

2015-01-22 Thread John Hartnup
Actually there is already a bug record: https://issues.apache.org/jira/browse/FTPSERVER-459 On Thu Jan 22 2015 at 12:00:19 John Hartnup john.hart...@gmail.com wrote: The last commit to the project was Nov 2012 -- is anyone actively maintaining this project? https://git-wip-us.apache.org

Re: disable sslv3

2015-01-22 Thread John Hartnup
The last commit to the project was Nov 2012 -- is anyone actively maintaining this project? https://git-wip-us.apache.org/repos/asf?p=mina-ftpserver.git;a=summary That said, it may be worth raising a bug at https://issues.apache.org/jira/browse/FTPSERVER/ -- you can attach your patch there -- I

Re: file-user-manager configuration and sftp

2015-06-23 Thread John Hartnup
Yes, as Franks says -- FTP/TLS (sometimes known as FTPS) is a completely different protocol from SFTP. Mine FtpServer is an FTPS server, not an SFTP server. On Tue, Jun 23, 2015 at 9:27 AM Frank kl...@hotmail.com wrote: Hi Jean-Max, Try ftps instead of sftp; sftp is an extension of ssh for

Re: Restricting hidden files to upload

2017-02-20 Thread John Hartnup
Do you want to forbid upload of hidden files? I think if your onUploadStart() sends a `550 Permission Denied` response, then returns SKIP, you'll achieve that goal. You would not need to delete the file, as it would never get created. You would need a different way to tell if the file is hidden

Re: Embedded FTP Server / adding files

2017-10-27 Thread John Hartnup
The simplest approach is probably the standard FileSystemViews configured to use a temporary directory. Your tests can populate and check the contents of that directory directly. Slightly more sophisticated - you could create an in-memory filesystem. Have a look at this as an example: