public void execute()

in core/src/main/java/org/apache/ftpserver/command/impl/REST.java [53:101]


    public void execute(final FtpIoSession session,
            final FtpServerContext context, final FtpRequest request)
            throws IOException {

        // argument check
        String argument = request.getArgument();
        if (argument == null) {
            session.write(LocalizedFtpReply.translate(session, request, context,
                    FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,
                    "REST", null));
            return;
        }

        // get offset number
        session.resetState();
        long skipLen = 0L;
        try {
            skipLen = Long.parseLong(argument);

            // check offset number
            if (skipLen < 0L) {
                skipLen = 0L;
                session
                        .write(LocalizedFtpReply
                                .translate(
                                        session,
                                        request,
                                        context,
                                        FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,
                                        "REST.negetive", null));
            } else {
                session
                        .write(LocalizedFtpReply
                                .translate(
                                        session,
                                        request,
                                        context,
                                        FtpReply.REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION,
                                        "REST", null));
            }
        } catch (NumberFormatException ex) {
            LOG.debug("Invalid restart position: " + argument, ex);
            session.write(LocalizedFtpReply.translate(session, request, context,
                    FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,
                    "REST.invalid", null));
        }

        session.setFileOffset(skipLen);
    }