public ScpToMessage(boolean verbose, Session session, File aLocalFile, String aRemotePath) { this(verbose, session, aRemotePath); this.localFile = aLocalFile; } /** * Constructor for a local directories to remote. * @param verbose if true do verbose logging * @param session the scp session to use * @param aDirectoryList a list of directories * @param aRemotePath the remote path * @since Ant 1.6.2 */ public ScpToMessage(boolean verbose, Session session, List aDirectoryList, String aRemotePath) { this(verbose, session, aRemotePath); this.directoryList = aDirectoryList; } /** * Constructor for ScpToMessage. * @param verbose if true do verbose logging * @param session the scp session to use * @param aRemotePath the remote path * @since Ant 1.6.2 */ private ScpToMessage(boolean verbose, Session session, String aRemotePath) { super(verbose, session); this.remotePath = aRemotePath; } /** * Constructor for ScpToMessage. * @param session the scp session to use * @param aLocalFile the local file * @param aRemotePath the remote path */ public ScpToMessage(Session session, File aLocalFile, String aRemotePath) { this(false, session, aLocalFile, aRemotePath); } /** * Constructor for ScpToMessage. * @param session the scp session to use * @param aDirectoryList a list of directories * @param aRemotePath the remote path */ public ScpToMessage(Session session, List aDirectoryList, String aRemotePath) { this(false, session, aDirectoryList, aRemotePath); } /** * Carry out the transfer. * @throws IOException on i/o errors * @throws JSchException on errors detected by scp */ public void execute() throws IOException, JSchException { if (directoryList != null) { doMultipleTransfer(); } if (localFile != null) { doSingleTransfer(); } log("done.\n")
public ScpToMessageBySftp(boolean verbose, Session session, File aLocalFile, String aRemotePath) { this(verbose, session, aRemotePath); this.localFile = aLocalFile; } /** * Constructor for a local directories to remote. * @param verbose if true do verbose logging * @param session the scp session to use * @param aDirectoryList a list of directories * @param aRemotePath the remote path * @since Ant 1.7 */ public ScpToMessageBySftp(boolean verbose, Session session, List aDirectoryList, String aRemotePath) { this(verbose, session, aRemotePath); this.directoryList = aDirectoryList; } /** * Constructor for ScpToMessage. * @param verbose if true do verbose logging * @param session the scp session to use * @param aRemotePath the remote path * @since Ant 1.6.2 */ private ScpToMessageBySftp(boolean verbose, Session session, String aRemotePath) { super(verbose, session); this.remotePath = aRemotePath; } /** * Constructor for ScpToMessage. * @param session the scp session to use * @param aLocalFile the local file * @param aRemotePath the remote path */ public ScpToMessageBySftp(Session session, File aLocalFile, String aRemotePath) { this(false, session, aLocalFile, aRemotePath); } /** * Constructor for ScpToMessage. * @param session the scp session to use * @param aDirectoryList a list of directories * @param aRemotePath the remote path */ public ScpToMessageBySftp(Session session, List aDirectoryList, String aRemotePath) { this(false, session, aDirectoryList, aRemotePath); } /** * Carry out the transfer. * @throws IOException on i/o errors * @throws JSchException on errors detected by scp */ public void execute() throws IOException, JSchException { if (directoryList != null) { doMultipleTransfer(); } if (localFile != null) { doSingleTransfer(); } log("done.\n")
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessage.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ssh/ScpToMessageBySftp.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public ScpToMessage(boolean verbose,
1
public 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")
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0