本文整理匯總了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() + "'");
}
}
示例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;
}
}
示例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)));
}
}
示例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));
}
示例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)));
}
示例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));
}
示例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));
}