【发布时间】:2014-08-22 09:20:10
【问题描述】:
当我尝试通过 SFTP 连接我们的 alfresco 时,它无法连接 alfresco。它挂起资源管理器,并且记录器文件中也没有错误。
public void FTPTest()throws SocketException, IOException, NoSuchAlgorithmException
{
FTPSClient ftp = new FTPSClient("SSL");
System.out.println("1");
ftp.connect("172.17.178.144",2121); // or "localhost" in your case
System.out.println("2"+ftp.getReplyString());
System.out.println("login: "+ftp.login("admin", "admin"));
System.out.println("3"+ ftp.getReplyString());
ftp.changeWorkingDirectory("/alfresco");
// list the files of the current directory
FTPFile[] files = ftp.listFiles();
System.out.println("Listed "+files.length+" files.");
for(FTPFile file : files) {
System.out.println(file.getName());
}
// lets pretend there is a JPEG image in the present folder that we want to copy to the desktop (on a windows machine)
ftp.setFileType(FTPClient.BINARY_FILE_TYPE); // don't forget to change to binary mode! or you will have a scrambled image!
FileOutputStream br = new FileOutputStream("C:\\Documents and Settings\\casonkl\\Desktop\\my_downloaded_image_new_name.jpg");
ftp.retrieveFile("name_of_image_on_server.jpg", br);
ftp.disconnect();
}
我只在我们的控制台中得到了输出 1 在执行 ftp.connect("172.17.178.144",2121);这个代码系统将被挂起,在我们的控制台中没有错误
我可以使用 Filezila FTP 客户端软件通过 SFTP 连接到我的 Alfresco。谁能帮我解决这个问题?
【问题讨论】:
标签: java alfresco ftp-client ftps