tags:

views:

188

answers:

4

Hey guys, I've been looking all over for this and can't seem to find anything. Is there any library for Java that can let you easily implement an SFTP server in your application? I'm trying to receive files via SFTP, but I can't seem to find any implementation of an SFTP server.

I've found FTP/SFTP/FTPS client libraries, and FTP/FTPS server libraries, but none for a server for SFTP. Am I just blind? To clarify, i'm trying to receive files via SFTP. Not "get" or "put" files from my application to another existing server.

Right now my application lets the users connect to the local linux SFTP server, drop the files, and then my application polls the directory, but I feel that this is a poor implementation; I hate the idea of "polling" directories, but unfortunately they HAVE to use SFTP. Any suggestions?

A: 

http://sourceforge.net/projects/javasecureftpd/

pakore
The link you provided is not a java library, it is a standalone product. Also, it does not appear to use SFTP, but instead FTPS. Did you read anything about this product, or did you just pick the second link when you googled "java secure ftp"?
CB
My apologies, I went through a link that said that javasecureftpd was implementing SFTP and I thought it did. Anyway, you don't have to be mean, I was just trying to help you.
pakore
A: 

I suggest that you take a look at Apache Camel. It supports both FTP, FTPS as well as SFTP

matsev
Here's a direct quote from the Apache Camel website you linked:"This component provides access to remote file systems over the FTP and SFTP protocols."Key point being "access to remote file systems", this does not allow you to host your own SFTP server.
CB
+1  A: 

Please notice that SFTP is a not FTP over SSL, nor FTP over SSH. The SFTP server support requires an implementation of SSHD in Java. Your best bet is Apache SSHD,

http://mina.apache.org/sshd/

I never used the SFTP but I heard it's basic but functional.

ZZ Coder
A: 

Take a look at SSHTools (j2ssh). It includes a client and server.

However polling a directory isn't that bad an idea - it's probably much more reliable than setting up your own SFTP server using j2ssh. I've lost count of the number of applications I've encountered that do this kind of polling, and it usually works quite well.

Bruce Blackshaw