1 | ScpToMessage(boolean verbose,↵ | | 1 | ScpToMessageBySftp(boolean verbose,↵
|
2 | Session session,↵ | | 2 | Session session,↵
|
3 | File aLocalFile,↵ | | 3 | File aLocalFile,↵
|
4 | String aRemotePath) {↵ | | 4 | String aRemotePath) {↵
|
5 | this(verbose, session, aRemotePath);↵ | | 5 | this(verbose, session, aRemotePath);↵
|
|
6 | this.localFile = aLocalFile;↵ | | 6 | this.localFile = aLocalFile;↵
|
7 | }↵ | | 7 | }↵
|
|
8 | /**↵ | | 8 | /**↵
|
9 | * Constructor for a local directories to remote.↵ | | 9 | * Constructor for a local directories to remote.↵
|
10 | * @param verbose if true do verbose logging↵ | | 10 | * @param verbose if true do verbose logging↵
|
11 | * @param session the scp session to use↵ | | 11 | * @param session the scp session to use↵
|
12 | * @param aDirectoryList a list of directories↵ | | 12 | * @param aDirectoryList a list of directories↵
|
13 | * @param aRemotePath the remote path↵ | | 13 | * @param aRemotePath the remote path↵
|
14 | * @since Ant 1.6.2↵ | | 14 | * @since Ant 1.7↵
|
15 | */↵ | | 15 | */↵
|
16 | public ScpToMessage(boolean verbose,↵ | | 16 | public ScpToMessageBySftp(boolean verbose,↵
|
17 | Session session,↵ | | 17 | Session session,↵
|
18 | List aDirectoryList,↵ | | 18 | List aDirectoryList,↵
|
19 | String aRemotePath) {↵ | | 19 | String aRemotePath) {↵
|
20 | this(verbose, session, aRemotePath);↵ | | 20 | this(verbose, session, aRemotePath);↵
|
|
21 | this.directoryList = aDirectoryList;↵ | | 21 | this.directoryList = aDirectoryList;↵
|
22 | }↵ | | 22 | }↵
|
|
23 | /**↵ | | 23 | /**↵
|
24 | * Constructor for ScpToMessage.↵ | | 24 | * Constructor for ScpToMessage.↵
|
25 | * @param verbose if true do verbose logging↵ | | 25 | * @param verbose if true do verbose logging↵
|
26 | * @param session the scp session to use↵ | | 26 | * @param session the scp session to use↵
|
27 | * @param aRemotePath the remote path↵ | | 27 | * @param aRemotePath the remote path↵
|
28 | * @since Ant 1.6.2↵ | | 28 | * @since Ant 1.6.2↵
|
29 | */↵ | | 29 | */↵
|
30 | private ScpToMessage(boolean verbose,↵ | | 30 | private ScpToMessageBySftp(boolean verbose,↵
|
31 | Session session,↵ | | 31 | Session session,↵
|
32 | String aRemotePath) {↵ | | 32 | String aRemotePath) {↵
|
33 | super(verbose, session);↵ | | 33 | super(verbose, session);↵
|
34 | this.remotePath = aRemotePath;↵ | | 34 | this.remotePath = aRemotePath;↵
|
35 | }↵ | | 35 | }↵
|
|
36 | /**↵ | | 36 | /**↵
|
37 | * Constructor for ScpToMessage.↵ | | 37 | * Constructor for ScpToMessage.↵
|
38 | * @param session the scp session to use↵ | | 38 | * @param session the scp session to use↵
|
39 | * @param aLocalFile the local file↵ | | 39 | * @param aLocalFile the local file↵
|
40 | * @param aRemotePath the remote path↵ | | 40 | * @param aRemotePath the remote path↵
|
41 | */↵ | | 41 | */↵
|
42 | public ScpToMessage(Session session,↵ | | 42 | public ScpToMessageBySftp(Session session,↵
|
43 | File aLocalFile,↵ | | 43 | File aLocalFile,↵
|
44 | String aRemotePath) {↵ | | 44 | String aRemotePath) {↵
|
45 | this(false, session, aLocalFile, aRemotePath);↵ | | 45 | this(false, session, aLocalFile, aRemotePath);↵
|
46 | }↵ | | 46 | }↵
|
|
47 | /**↵ | | 47 | /**↵
|
48 | * Constructor for ScpToMessage.↵ | | 48 | * Constructor for ScpToMessage.↵
|
49 | * @param session the scp session to use↵ | | 49 | * @param session the scp session to use↵
|
50 | * @param aDirectoryList a list of directories↵ | | 50 | * @param aDirectoryList a list of directories↵
|
51 | * @param aRemotePath the remote path↵ | | 51 | * @param aRemotePath the remote path↵
|
52 | */↵ | | 52 | */↵
|
53 | public ScpToMessage(Session session,↵ | | 53 | public ScpToMessageBySftp(Session session,↵
|
54 | List aDirectoryList,↵ | | 54 | List aDirectoryList,↵
|
55 | String aRemotePath) {↵ | | 55 | String aRemotePath) {↵
|
56 | this(false, session, aDirectoryList, aRemotePath);↵ | | 56 | this(false, session, aDirectoryList, aRemotePath);↵
|
57 | }↵ | | 57 | }↵
|
|
58 | /**↵ | | 58 | /**↵
|
59 | * Carry out the transfer.↵ | | 59 | * Carry out the transfer.↵
|
60 | * @throws IOException on i/o errors↵ | | 60 | * @throws IOException on i/o errors↵
|
61 | * @throws JSchException on errors detected by scp↵ | | 61 | * @throws JSchException on errors detected by scp↵
|
62 | */↵ | | 62 | */↵
|
63 | public void execute() throws IOException, JSchException {↵ | | 63 | public void execute() throws IOException, JSchException {↵
|
64 | if (directoryList != null) {↵ | | 64 | if (directoryList != null) {↵
|
65 | doMultipleTransfer();↵ | | 65 | doMultipleTransfer();↵
|
66 | }↵ | | 66 | }↵
|
67 | if (localFile != null) {↵ | | 67 | if (localFile != null) {↵
|
68 | doSingleTransfer();↵ | | 68 | doSingleTransfer();↵
|
69 | }↵ | | 69 | }↵
|
70 | log("done.\n");↵ | | 70 | log("done.\n");↵
|
71 | | | 71 |
|