當前位置: 首頁>>代碼示例>>Java>>正文


Java FTPReply.isPositiveIntermediate方法代碼示例

本文整理匯總了Java中org.apache.commons.net.ftp.FTPReply.isPositiveIntermediate方法的典型用法代碼示例。如果您正苦於以下問題:Java FTPReply.isPositiveIntermediate方法的具體用法?Java FTPReply.isPositiveIntermediate怎麽用?Java FTPReply.isPositiveIntermediate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.net.ftp.FTPReply的用法示例。


在下文中一共展示了FTPReply.isPositiveIntermediate方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: assertValidReplyCode

import org.apache.commons.net.ftp.FTPReply; //導入方法依賴的package包/類
/***********************************************************************/
private static void assertValidReplyCode(int code, FTPClient ftp)
{
  if (FTPReply.isPositiveCompletion(code))
  {
    //good
    SimpleLogger.variable("Good Completion code " + code);
  }
  else if (FTPReply.isPositiveIntermediate(code))
  {
    // do nothing
    SimpleLogger.variable("Good Intermediate code " + code);
  }
  else if (FTPReply.isPositivePreliminary(code))
  {
    // do nothing
    SimpleLogger.variable("Good Preliminary code " + code);
  }
  else
  {
    // bad
    throw new Error("Problem encountered with FTP Server, returned Code " + code + ", replied '"
        + ftp.getReplyString() + "'");
  }
}
 
開發者ID:approvals,項目名稱:ApprovalTests.Java,代碼行數:26,代碼來源:NetUtils.java

示例2: moveTo

import org.apache.commons.net.ftp.FTPReply; //導入方法依賴的package包/類
public AbstractFile moveTo(String newpath) {
	/*if (configurator.readonly) {
		return null;
	}*/
	if (newpath.startsWith("/") == false) {
		newpath = "/" + newpath;
	}
	
	try {
		String newpath_ = (root_path + newpath).replaceAll("//", "/");
		
		if (FTPReply.isPositiveIntermediate(ftpclient.rnfr(root_path + path))) {
			if (FTPReply.isPositiveCompletion(ftpclient.rnto(newpath_))) {
				return new AbstractFileFtp(this, getRandomFtpFile(newpath_), newpath);
			} else {
				throw new IOException("Can't rename, set to new name");
			}
		} else {
			throw new IOException("Can't rename, prepare name");
		}
	} catch (IOException e) {
		/** Maybe a security problem */
		Loggers.Storage_FTP.error("Can't access to file, " + this, e);
		return null;
	}
}
 
開發者ID:hdsdi3g,項目名稱:MyDMAM,代碼行數:27,代碼來源:StorageFTP.java

示例3: login

import org.apache.commons.net.ftp.FTPReply; //導入方法依賴的package包/類
public boolean login(String username, String password, String account) throws IOException {
   this.user(username);
   if(FTPReply.isPositiveCompletion(this._replyCode)) {
      return true;
   } else if(!FTPReply.isPositiveIntermediate(this._replyCode)) {
      return false;
   } else {
      this.pass(password);
      return FTPReply.isPositiveCompletion(this._replyCode)?true:(!FTPReply.isPositiveIntermediate(this._replyCode)?false:FTPReply.isPositiveCompletion(this.acct(account)));
   }
}
 
開發者ID:Bolt-Thrower,項目名稱:xdm,代碼行數:12,代碼來源:FTPClient.java

示例4: login

import org.apache.commons.net.ftp.FTPReply; //導入方法依賴的package包/類
/***
 * Login to the FTP server using the provided username and password.
 * <p>
 * @param username The username to login under.
 * @param password The password to use.
 * @return True if successfully completed, false if not.
 * @exception FTPConnectionClosedException
 *      If the FTP server prematurely closes the connection as a result
 *      of the client being idle or some other reason causing the server
 *      to send FTP reply code 421.  This exception may be caught either
 *      as an IOException or independently as itself.
 * @exception IOException  If an I/O error occurs while either sending a
 *      command to the server or receiving a reply from the server.
 ***/
public boolean login(String username, String password) throws IOException
{
    user(username);

    if (FTPReply.isPositiveCompletion(getReplyCode()))
        return true;

    // If we get here, we either have an error code, or an intermmediate
    // reply requesting password.
    if (!FTPReply.isPositiveIntermediate(getReplyCode()))
        return false;

    return FTPReply.isPositiveCompletion(pass(password));
}
 
開發者ID:yahoo,項目名稱:anthelion,代碼行數:29,代碼來源:Client.java

示例5: restart

import org.apache.commons.net.ftp.FTPReply; //導入方法依賴的package包/類
protected boolean restart(long offset) throws IOException {
   this.__restartOffset = 0L;
   return FTPReply.isPositiveIntermediate(this.rest(Long.toString(offset)));
}
 
開發者ID:Bolt-Thrower,項目名稱:xdm,代碼行數:5,代碼來源:FTPClient.java

示例6: rename

import org.apache.commons.net.ftp.FTPReply; //導入方法依賴的package包/類
public boolean rename(String from, String to) throws IOException {
   return !FTPReply.isPositiveIntermediate(this.rnfr(from))?false:FTPReply.isPositiveCompletion(this.rnto(to));
}
 
開發者ID:Bolt-Thrower,項目名稱:xdm,代碼行數:4,代碼來源:FTPClient.java

示例7: login

import org.apache.commons.net.ftp.FTPReply; //導入方法依賴的package包/類
/***
 * Login to the FTP server using the provided username and password.
 * <p>
 * 
 * @param username
 *          The username to login under.
 * @param password
 *          The password to use.
 * @return True if successfully completed, false if not.
 * @exception FTPConnectionClosedException
 *              If the FTP server prematurely closes the connection as a
 *              result of the client being idle or some other reason causing
 *              the server to send FTP reply code 421. This exception may be
 *              caught either as an IOException or independently as itself.
 * @exception IOException
 *              If an I/O error occurs while either sending a command to the
 *              server or receiving a reply from the server.
 ***/
public boolean login(String username, String password) throws IOException {
  user(username);

  if (FTPReply.isPositiveCompletion(getReplyCode()))
    return true;

  // If we get here, we either have an error code, or an intermmediate
  // reply requesting password.
  if (!FTPReply.isPositiveIntermediate(getReplyCode()))
    return false;

  return FTPReply.isPositiveCompletion(pass(password));
}
 
開發者ID:jorcox,項目名稱:GeoCrawler,代碼行數:32,代碼來源:Client.java


注:本文中的org.apache.commons.net.ftp.FTPReply.isPositiveIntermediate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。