/** * Changes the file name to the given name while sending it, * only useful if sending a single file. * @param aToUri a string representing the target of the copy. * @since Ant 1.6.2 */ public void setRemoteTofile(final String aToUri) { validateRemoteUri("remoteToFile", aToUri); setToUri(aToUri); this.isToRemote = true; }
/** * Similar to {@link #setTodir setTodir} but explicitly states * that the directory is a local. This is the only way to specify * a local directory with a @ character. * @param aToUri a string representing the target of the copy. * @since Ant 1.6.2 */ public void setLocalTodir(final String aToUri) { setToUri(aToUri); this.isToRemote = false; }
/** * Setting this to true trusts hosts whose identity is unknown. * * @param yesOrNo if true trust the identity of unknown hosts. */ public void setTrust(final boolean yesOrNo) { userInfo.setTrust(yesOrNo); }
/** * Username known to remote host. * * @param username * The new username value */ public void setUsername(String username) { exec.setUsername(username); scp.setUsername(username); userInfo.setName(username); }
/** * Sets the password for the user. * * @param password * The new password value */ public void setPassword(String password) { userInfo.setPassword(password); }
/** * Username known to remote host. * * @param username The new username value */ public void setUsername(final String username) { userInfo.setName(username); }
/** * Sets the keyfile for the user. * * @param keyfile The new keyfile value */ public void setKeyfile(final String keyfile) { userInfo.setKeyfile(keyfile); }
/** * Sets the passphrase for the users key. * * @param passphrase * The new passphrase value */ public void setPassphrase(String passphrase) { userInfo.setPassphrase(passphrase); }
/** * Similar to {@link #setFile setFile} but explicitly states that * the file is a remote file. * @param aFromUri a string representing the source of the copy. * @since Ant 1.6.2 */ public void setRemoteFile(final String aFromUri) { validateRemoteUri("remoteFile", aFromUri); setFromUri(aFromUri); this.isFromRemote = true; }
/** * Initialize this task. * @throws BuildException on error */ @Override public void init() throws BuildException { super.init(); this.toUri = null; this.fromUri = null; this.rcs = null; }
/** * Get the progress monitor. * @return the progress monitor. */ protected SftpProgressMonitor getProgressMonitor() { if (monitor == null) { monitor = new ProgressMonitor(); } return monitor; }
/** * Log a message to the log listener. * @param message the message to log */ protected void log(final String message) { listener.log(message); }
@Override public boolean count(final long len) { totalLength += len; percentTransmitted = trackProgress(initFileSize, totalLength, percentTransmitted); return true; }
/** * Similar to {@link #setFile setFile} but explicitly states that * the file is a local file. This is the only way to specify a * local file with a @ character. * @param aFromUri a string representing the source of the copy. * @since Ant 1.6.2 */ public void setLocalFile(final String aFromUri) { setFromUri(aFromUri); this.isFromRemote = false; }
private void setFromUri(final String fromUri) { if (this.fromUri != null) { throw exactlyOne(FROM_ATTRS); } this.fromUri = fromUri; }
@Override public void log(final int level, final String message) { base.log(message, Project.MSG_INFO); } });
/** * Sets the path to the file that has the identities of * all known hosts. This is used by SSH protocol to validate * the identity of the host. The default is * <i>${user.home}/.ssh/known_hosts</i>. * * @param knownHosts a path to the known hosts file. */ public void setKnownhosts(String knownHosts) { this.knownHosts = knownHosts; super.setKnownhosts(knownHosts); }
/** * Similar to {@link #setTodir setTodir} but explicitly states * that the directory is a remote. * @param aToUri a string representing the target of the copy. * @since Ant 1.6.2 */ public void setRemoteTodir(final String aToUri) { validateRemoteUri("remoteToDir", aToUri); setToUri(aToUri); this.isToRemote = true; }
/** * Sets the password for the user. * * @param password The new password value */ public void setPassword(final String password) { userInfo.setPassword(password); }
/** * Changes the file name to the given name while receiving it, * only useful if receiving a single file. * @param aToUri a string representing the target of the copy. * @since Ant 1.6.2 */ public void setLocalTofile(final String aToUri) { setToUri(aToUri); this.isToRemote = false; }