📄 ftp.java
字号:
* Sets the FTP server to send files to. * * @param server the remote server name. */ public void setServer(String server) { this.server = server; } /** * Sets the FTP port used by the remote server. * * @param port the port on which the remote server is listening. */ public void setPort(int port) { this.port = port; } /** * Sets the login user id to use on the specified server. * * @param userid remote system userid. */ public void setUserid(String userid) { this.userid = userid; } /** * Sets the login password for the given user id. * * @param password the password on the remote system. */ public void setPassword(String password) { this.password = password; } /** * Sets the login account to use on the specified server. * * @param pAccount the account name on remote system * @since Ant 1.7 */ public void setAccount(String pAccount) { this.account = pAccount; } /** * If true, uses binary mode, otherwise text mode (default is binary). * * @param binary if true use binary mode in transfers. */ public void setBinary(boolean binary) { this.binary = binary; } /** * Specifies whether to use passive mode. Set to true if you are behind a * firewall and cannot connect without it. Passive mode is disabled by * default. * * @param passive true is passive mode should be used. */ public void setPassive(boolean passive) { this.passive = passive; } /** * Set to true to receive notification about each file as it is * transferred. * * @param verbose true if verbose notifications are required. */ public void setVerbose(boolean verbose) { this.verbose = verbose; } /** * A synonym for <tt>depends</tt>. Set to true to transmit only new * or changed files. * * See the related attributes timediffmillis and timediffauto. * * @param newer if true only transfer newer files. */ public void setNewer(boolean newer) { this.newerOnly = newer; } /** * number of milliseconds to add to the time on the remote machine * to get the time on the local machine. * * use in conjunction with <code>newer</code> * * @param timeDiffMillis number of milliseconds * * @since ant 1.6 */ public void setTimeDiffMillis(long timeDiffMillis) { this.timeDiffMillis = timeDiffMillis; } /** * "true" to find out automatically the time difference * between local and remote machine. * * This requires right to create * and delete a temporary file in the remote directory. * * @param timeDiffAuto true = find automatically the time diff * * @since ant 1.6 */ public void setTimeDiffAuto(boolean timeDiffAuto) { this.timeDiffAuto = timeDiffAuto; } /** * Set to true to preserve modification times for "gotten" files. * * @param preserveLastModified if true preserver modification times. */ public void setPreserveLastModified(boolean preserveLastModified) { this.preserveLastModified = preserveLastModified; } /** * Set to true to transmit only files that are new or changed from their * remote counterparts. The default is to transmit all files. * * @param depends if true only transfer newer files. */ public void setDepends(boolean depends) { this.newerOnly = depends; } /** * Sets the remote file separator character. This normally defaults to the * Unix standard forward slash, but can be manually overridden using this * call if the remote server requires some other separator. Only the first * character of the string is used. * * @param separator the file separator on the remote system. */ public void setSeparator(String separator) { remoteFileSep = separator; } /** * Sets the file permission mode (Unix only) for files sent to the * server. * * @param theMode unix style file mode for the files sent to the remote * system. */ public void setChmod(String theMode) { this.chmod = theMode; } /** * Sets the default mask for file creation on a unix server. * * @param theUmask unix style umask for files created on the remote server. */ public void setUmask(String theUmask) { this.umask = theUmask; } /** * A set of files to upload or download * * @param set the set of files to be added to the list of files to be * transferred. */ public void addFileset(FileSet set) { filesets.addElement(set); } /** * Sets the FTP action to be taken. Currently accepts "put", "get", "del", * "mkdir", "chmod", "list", and "site". * * @deprecated since 1.5.x. * setAction(String) is deprecated and is replaced with * setAction(FTP.Action) to make Ant's Introspection mechanism do the * work and also to encapsulate operations on the type in its own * class. * @ant.attribute ignore="true" * * @param action the FTP action to be performed. * * @throws BuildException if the action is not a valid action. */ public void setAction(String action) throws BuildException { log("DEPRECATED - The setAction(String) method has been deprecated." + " Use setAction(FTP.Action) instead."); Action a = new Action(); a.setValue(action); this.action = a.getAction(); } /** * Sets the FTP action to be taken. Currently accepts "put", "get", "del", * "mkdir", "chmod", "list", and "site". * * @param action the FTP action to be performed. * * @throws BuildException if the action is not a valid action. */ public void setAction(Action action) throws BuildException { this.action = action.getAction(); } /** * The output file for the "list" action. This attribute is ignored for * any other actions. * * @param listing file in which to store the listing. */ public void setListing(File listing) { this.listing = listing; } /** * If true, enables unsuccessful file put, delete and get * operations to be skipped with a warning and the remainder * of the files still transferred. * * @param skipFailedTransfers true if failures in transfers are ignored. */ public void setSkipFailedTransfers(boolean skipFailedTransfers) { this.skipFailedTransfers = skipFailedTransfers; } /** * set the flag to skip errors on directory creation. * (and maybe later other server specific errors) * * @param ignoreNoncriticalErrors true if non-critical errors should not * cause a failure. */ public void setIgnoreNoncriticalErrors(boolean ignoreNoncriticalErrors) { this.ignoreNoncriticalErrors = ignoreNoncriticalErrors; } private void configurationHasBeenSet() { this.isConfigurationSet = true; } /** * Sets the systemTypeKey attribute. * Method for setting <code>FTPClientConfig</code> remote system key. * * @param systemKey the key to be set - BUT if blank * the default value of null (which signifies "autodetect") will be kept. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setSystemTypeKey(FTPSystemType systemKey) { if (systemKey != null && !systemKey.getValue().equals("")) { this.systemTypeKey = systemKey; configurationHasBeenSet(); } } /** * Sets the defaultDateFormatConfig attribute. * @param defaultDateFormat configuration to be set, unless it is * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setDefaultDateFormatConfig(String defaultDateFormat) { if (defaultDateFormat != null && !defaultDateFormat.equals("")) { this.defaultDateFormatConfig = defaultDateFormat; configurationHasBeenSet(); } } /** * Sets the recentDateFormatConfig attribute. * @param recentDateFormat configuration to be set, unless it is * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setRecentDateFormatConfig(String recentDateFormat) { if (recentDateFormat != null && !recentDateFormat.equals("")) { this.recentDateFormatConfig = recentDateFormat; configurationHasBeenSet(); } } /** * Sets the serverLanguageCode attribute. * @param serverLanguageCode configuration to be set, unless it is * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setServerLanguageCodeConfig(LanguageCode serverLanguageCode) { if (serverLanguageCode != null && !serverLanguageCode.equals("")) { this.serverLanguageCodeConfig = serverLanguageCode; configurationHasBeenSet(); } } /** * Sets the serverTimeZoneConfig attribute. * @param serverTimeZoneId configuration to be set, unless it is * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setServerTimeZoneConfig(String serverTimeZoneId) { if (serverTimeZoneId != null && !serverTimeZoneId.equals("")) { this.serverTimeZoneConfig = serverTimeZoneId; configurationHasBeenSet(); } } /** * Sets the shortMonthNamesConfig attribute * * @param shortMonthNames configuration to be set, unless it is * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setShortMonthNamesConfig(String shortMonthNames) { if (shortMonthNames != null && !shortMonthNames.equals("")) { this.shortMonthNamesConfig = shortMonthNames;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -