Java Code Examples for com.jcraft.jsch.ChannelSftp#pwd()

The following examples show how to use com.jcraft.jsch.ChannelSftp#pwd() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SFTPEnvironment.java    From sftp-fs with Apache License 2.0 5 votes vote down vote up
void verifyConnection(ChannelSftp channel) throws IOException {
    try {
        channel.pwd();
    } catch (SftpException e) {
        throw asFileSystemException(e);
    }
}
 
Example 2
Source File: SftpLightWeightFileSystem.java    From incubator-gobblin with Apache License 2.0 5 votes vote down vote up
@Override
public Path getWorkingDirectory() {
  ChannelSftp channelSftp = null;
  try {
    channelSftp = this.fsHelper.getSftpChannel();
    Path workingDir = new Path(channelSftp.pwd());

    return workingDir;
  } catch (SftpException e) {
    return null;
  } finally {
    safeDisconnect(channelSftp);
  }
}