Using JSch, is there a way to tell if a remote file exists without doing an ls and looping through the files to find a name match?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(This is if you’re using the SFTP part of the library, an assumption I made without thinking about it.)
I thought its
ls(String path)would accept filenames; I can’t check at the moment.If it doesn’t, you don’t need to iterate manually; you can use the selector variant: