just_user
just_user

Reputation: 12067

jsch sftp - change to parent directory

I'm trying to figure out how to figure out how to go to the parent directory using Jsch Sftp.

I have the current path stored in a string and I'm guessing that channelSftp.cd(String); is what I should use. But using substring on the current path I have feels wrong. Is there a better way to do this?

Upvotes: 1

Views: 5998

Answers (1)

323go
323go

Reputation: 14274

Same as in the shell:

channelSftp.cd("..");

Upvotes: 7

Related Questions