Sanjay Rabari
Sanjay Rabari

Reputation: 2081

Download multiple extensions file from remote using JSCH

I have remote directory /remote/Dir which have many files with different extensions.

like

     *.abc
     *.xyz
     *.pqr

I want to dowload all files ended with .abc .xyz .pqr

so in this case How I use JSCh?

Upvotes: 1

Views: 1148

Answers (1)

myxlptlk
myxlptlk

Reputation: 139

Add all the ls results in a vector.

Vector<ChannelSftp.LsEntry> list = channelSftp.ls("*.abc");
list.addAll(channelSftp.ls("*.xyz"));
list.addAll(channelSftp.ls("*.pqr"));

After you need to execute a for loop on this list to gett all the matching files..

Upvotes: 2

Related Questions