Example usage for org.apache.commons.net.ftp FTPReply ACTION_ABORTED

List of usage examples for org.apache.commons.net.ftp FTPReply ACTION_ABORTED

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPReply ACTION_ABORTED.

Prototype

int ACTION_ABORTED

To view the source code for org.apache.commons.net.ftp FTPReply ACTION_ABORTED.

Click Source Link

Usage

From source file:ch.cyberduck.core.ftp.FTPExceptionMappingService.java

private BackgroundException handle(final FTPException e, final StringBuilder buffer) {
    final int status = e.getCode();
    switch (status) {
    case FTPReply.INSUFFICIENT_STORAGE:
    case FTPReply.STORAGE_ALLOCATION_EXCEEDED:
        return new QuotaException(buffer.toString(), e);
    case FTPReply.NOT_LOGGED_IN:
        return new LoginFailureException(buffer.toString(), e);
    case FTPReply.FAILED_SECURITY_CHECK:
    case FTPReply.DENIED_FOR_POLICY_REASONS:
    case FTPReply.NEED_ACCOUNT:
    case FTPReply.NEED_ACCOUNT_FOR_STORING_FILES:
    case FTPReply.FILE_NAME_NOT_ALLOWED:
    case FTPReply.ACTION_ABORTED:
        return new AccessDeniedException(buffer.toString(), e);
    case FTPReply.UNAVAILABLE_RESOURCE:
    case FTPReply.FILE_UNAVAILABLE:
        // Requested action not taken. File unavailable (e.g., file not found, no access)
        return new NotfoundException(buffer.toString(), e);
    case FTPReply.SERVICE_NOT_AVAILABLE:
        return new ConnectionRefusedException(buffer.toString(), e);
    }/*w  w w  .jav a  2 s .c om*/
    return new InteroperabilityException(buffer.toString(), e);
}