Android 我想了解文件在SFTP服务器上的位置

Android 我想了解文件在SFTP服务器上的位置,android,sftp,jsch,Android,Sftp,Jsch,我需要一个代码来学习服务器上文件的位置。我可以学习文件名,但不学习位置。例如,我想学习abc.txt,比如(\home\user1\desktop\abc.txt) 使用pwd()和lpwd()(ChannelSFTP类的操作)检索本地和远程工作目录。有关更多信息,请查看 要完成代码示例,请执行以下操作: JSch jsch = new JSch(); Session session = null; session = jsch.getSession("***", "***.***.***.**

我需要一个代码来学习服务器上文件的位置。我可以学习文件名,但不学习位置。例如,我想学习abc.txt,比如(\home\user1\desktop\abc.txt)

使用
pwd()
lpwd()
ChannelSFTP
类的操作)检索本地和远程工作目录。有关更多信息,请查看

要完成代码示例,请执行以下操作:

JSch jsch = new JSch();
Session session = null;
session = jsch.getSession("***", "***.***.***.***",22);
session.setConfig("StrictHostKeyChecking", "no");
session.setPassword("****");
session.connect();                  
Channel channel = session.openChannel("sftp");
channel.connect();
ChannelSftp sftpChannel = (ChannelSftp) channel;

System.out.println(sftpChannel.pwd());
System.out.println(sftpChannel.lpwd());

sftpChannel.exit(); 
session.disconnect(); }catch(JSchException e){writeToSDFile(" "+e.toString());}

非常感谢,我已经搜索了这两个星期,你帮助了我,你是国王。谢谢:)
JSch jsch = new JSch();
Session session = null;
session = jsch.getSession("***", "***.***.***.***",22);
session.setConfig("StrictHostKeyChecking", "no");
session.setPassword("****");
session.connect();                  
Channel channel = session.openChannel("sftp");
channel.connect();
ChannelSftp sftpChannel = (ChannelSftp) channel;

System.out.println(sftpChannel.pwd());
System.out.println(sftpChannel.lpwd());

sftpChannel.exit(); 
session.disconnect(); }catch(JSchException e){writeToSDFile(" "+e.toString());}