shikhar/sshj — Issue #48: SCPFileTransfer doesn't support wildcard in file path?
Author: sanlyfang
Created: 2011-12-26 15:26:01+00:00
State: open

version 0.6.1

This code works fine:
ssh.newSCPFileTransfer().download("/home/test.ini",
"C:/test");

But this doesn't work:
ssh.newSCPFileTransfer().download("/home/*.ini",
"C:/test");

Got error message:

02:22:31.190 [main] INFO n.s.s.c.c.direct.SessionChannel - Will request to exec `scp -f -q -p -r '/home/*.ini'`
02:22:31.191 [main] INFO n.s.s.c.c.direct.SessionChannel - Sending channel request for `exec`
02:22:31.193 [main] DEBUG net.schmizz.concurrent.Promise - Awaiting <>
02:22:31.254 [reader] INFO n.s.s.c.c.direct.SessionChannel - Received window adjustment for 2097152 bytes
02:22:31.255 [reader] DEBUG n.s.s.c.channel.Window$Remote - Increasing by 2097152 up to 0
02:22:31.255 [reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to `SOME`
02:22:31.256 [main] DEBUG net.schmizz.sshj.xfer.scp.SCPEngine - Signalling: Start status OK
02:22:31.256 [main] DEBUG n.s.s.c.channel.Window$Remote - Consuming by 1 down to 2097152
02:22:31.398 [reader] DEBUG n.s.s.c.channel.Window$Local - Consuming by 54 down to 2097152
02:22:31.398 [main] DEBUG net.schmizz.sshj.xfer.scp.SCPEngine - Read message: `scp: /home/*.ini: No such file or directory`
02:22:31.399 [main] INFO n.s.s.c.c.direct.SessionChannel - Sending close
02:22:31.399 [main] DEBUG net.schmizz.concurrent.Promise - Awaiting <>
02:22:31.400 [reader] INFO n.s.s.c.c.direct.SessionChannel - Got EOF
02:22:31.400 [reader] INFO n.s.s.c.c.direct.SessionChannel - Got chan request for `exit-status`
02:22:31.400 [reader] INFO n.s.s.c.c.direct.SessionChannel - Got close
02:22:31.401 [reader] INFO n.s.sshj.connection.ConnectionImpl - Forgetting `session` channel (#0)
02:22:31.401 [reader] DEBUG net.schmizz.concurrent.Promise - Setting <> to `SOME`
02:22:31.401 [main] WARN net.schmizz.sshj.xfer.scp.SCPEngine - SCP exit status: 1
02:22:31.401 [main] DEBUG n.s.sshj.transport.TransportImpl - Default disconnect listener - BY_APPLICATION
02:22:31.401 [main] DEBUG n.s.sshj.connection.ConnectionImpl - Notified of net.schmizz.sshj.transport.TransportException: [BY_APPLICATION] Disconnected
02:22:31.406 [main] DEBUG n.s.sshj.transport.TransportImpl - Sending SSH_MSG_DISCONNECT: reason=[BY_APPLICATION], msg=[]
02:22:31.407 [reader] DEBUG net.schmizz.sshj.transport.Reader - Stopping
02:22:31.407 [main] DEBUG net.schmizz.concurrent.Promise - Setting <> to `SOME`
Exception in thread "main" com.aot.loghub.ServerException: net.schmizz.sshj.xfer.scp.SCPException: Remote SCP command returned error: scp: /home/ecom/etc/*.ini: No such file or directory
at ServerClient.execute(ServerClient.java:38)
at ServerClientTest.main(ServerClientTest.java:11)
Caused by: net.schmizz.sshj.xfer.scp.SCPException: Remote SCP command returned error: scp: /home/*.ini: No such file or directory
at net.schmizz.sshj.xfer.scp.SCPDownloadClient.process(SCPDownloadClient.java:121)
at net.schmizz.sshj.xfer.scp.SCPDownloadClient.startCopy(SCPDownloadClient.java:74)
at net.schmizz.sshj.xfer.scp.SCPDownloadClient.copy(SCPDownloadClient.java:45)
at net.schmizz.sshj.xfer.scp.SCPFileTransfer.download(SCPFileTransfer.java:64)
at net.schmizz.sshj.xfer.scp.SCPFileTransfer.download(SCPFileTransfer.java:58)
at ServerClientTest$1.execute(ServerClientTest.java:14)
at ServerClient.execute(ServerClient.java:36)
... 1 more