本文介绍了Java的内存SFTP服务器有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些代码,我需要编写一个测试,连接到供应商的SFTP服务器并将文件放在那里。现在测试是连接到他们的实际服务器,但我宁愿不这样做。理想情况下,我想在中使用假的,内存中的服务器。我尝试使用那个并且它在那里得到一部分但是在发出实际命令时死亡,因为它不能识别它们。

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.

推荐答案

从:您可能是能够使用SSHTools(参见)。它们没有提供任何好的示例,但SVN中的代码库有一些类似乎表明它们支持SFTP服务器命令(参见和)。您需要做一些繁重的工作。

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.

这篇关于Java的内存SFTP服务器有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 01:25