org.apache.commons.net.ftp.FTPReply.isNegativePermanent()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中org.apache.commons.net.ftp.FTPReply.isNegativePermanent()方法的一些代码示例,展示了FTPReply.isNegativePermanent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FTPReply.isNegativePermanent()方法的具体详情如下:
包路径:org.apache.commons.net.ftp.FTPReply
类名称:FTPReply
方法名:isNegativePermanent

FTPReply.isNegativePermanent介绍

[英]Determine if a reply code is a negative permanent response. All codes beginning with a 5 are negative permanent responses. The FTP server will send a negative permanent response on the failure of a command that cannot be reattempted with success.
[中]确定回复代码是否为否定的永久响应。所有以5开头的代码均为负永久响应。FTP服务器将在命令失败时发送否定的永久响应,该命令无法成功重新尝试。

代码示例

代码示例来源:origin: apache/nifi

public void sendCommands(final List<String> commands, final FlowFile flowFile) throws IOException {
  if (commands.isEmpty()) {
    return;
  }
  final FTPClient client = getClient(flowFile);
  for (String cmd : commands) {
    if (!cmd.isEmpty()) {
      int result;
      result = client.sendCommand(cmd);
      logger.debug(this + " sent command to the FTP server: " + cmd + " for " + flowFile);
      if (FTPReply.isNegativePermanent(result) || FTPReply.isNegativeTransient(result)) {
        throw new IOException(this + " negative reply back from FTP server cmd: " + cmd + " reply:" + result + ": " + client.getReplyString() + " for " + flowFile);
      }
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

@Override
public synchronized String getNegativeReplyString() {
  int replyCode = ftpClient.getReplyCode();
  if (FTPReply.isNegativePermanent(replyCode)
      || FTPReply.isNegativeTransient(replyCode)) {
    return getReplyString();
  }
  return null;
}

代码示例来源:origin: fhoeben/hsac-fitnesse-fixtures

private static void validatResponse(FTPClient ftpClient) {
  if (FTPReply.isNegativeTransient(ftpClient.getReplyCode()) || FTPReply.isNegativePermanent(ftpClient.getReplyCode())) {
    throw new RuntimeException("Got error response: " + ftpClient.getReplyCode());
  }
}

代码示例来源:origin: org.apache.nifi/nifi-standard-processors

public void sendCommands(final List<String> commands, final FlowFile flowFile) throws IOException {
  if (commands.isEmpty()) {
    return;
  }
  final FTPClient client = getClient(flowFile);
  for (String cmd : commands) {
    if (!cmd.isEmpty()) {
      int result;
      result = client.sendCommand(cmd);
      logger.debug(this + " sent command to the FTP server: " + cmd + " for " + flowFile);
      if (FTPReply.isNegativePermanent(result) || FTPReply.isNegativeTransient(result)) {
        throw new IOException(this + " negative reply back from FTP server cmd: " + cmd + " reply:" + result + ": " + client.getReplyString() + " for " + flowFile);
      }
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

private void processEvent(ProtocolCommandEvent event) {
    String message = event.getMessage();
    if (message.startsWith("PASS ")) { // NOI18N
      // hide password
      message = "PASS ******"; // NOI18N
    }
    OutputWriter writer = null;
    if (event.isReply()
        && (FTPReply.isNegativeTransient(event.getReplyCode()) || FTPReply.isNegativePermanent(event.getReplyCode()))) {
      writer = io.getErr();
    } else {
      writer = io.getOut();
    }
    writer.println(message.trim());
    writer.flush();
    if (LOGGER.isLoggable(Level.FINE)) {
      LOGGER.log(Level.FINE, "Command listener: {0}", message.trim());
    }
  }
}

代码示例来源:origin: Alfresco/alfresco-repository

reply = ftp.getReplyCode();
assertTrue(FTPReply.isNegativePermanent(reply));

代码示例来源:origin: Alfresco/alfresco-repository

assertTrue(FTPReply.isNegativePermanent(reply));

相关文章