开发者

Any good in memory SFTP servers for Java? [closed]

开发者 https://www.devze.com 2023-03-06 10:02 出处:网络
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

开发者_开发知识库

Closed 5 years ago.

Improve this question

I have some code I need to write a test for that connects to a vendor's SFTP server and puts a file there. Right now the test is connecting to their actual server but I'd rather not do that. Ideally I'd like to use a fake, in memory, sever along the lines of MockFtpServer. The I tried using that one and it gets part of the way there but dies at the point of issuing the actual commands since it doesn't recognize them.

The code in question is a flow setup within Mule ESB.


From Java SFTP server library?: you might be able to use SSHTools (see http://sourceforge.net/projects/sshtools/). They don't provide any good examples but the code base in SVN has some classes that appear to indicate that they support SFTP server commands (see http://sshtools.svn.sourceforge.net/viewvc/sshtools/trunk/j2ssh/src/com/sshtools/daemon/sftp/ and http://sshtools.svn.sourceforge.net/viewvc/sshtools/trunk/j2ssh/src/com/sshtools/j2ssh/sftp/). Some heavy lifting on your part will be necessary.

Let me know if that helps.


You can use org.apache.sshd.server, see https://mina.apache.org/sshd-project/index.html.

It's not trivial to configure, but there is an example: https://github.com/ggrandes/sftpserver

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号