try { socketProvider = new SocketProvider(); }catch (IOException ioe) { String error = "Error creating SocketProvider: " + ioe.getMessage(); log.error(error,ioe); throw new NotConnectedException(error); }
socketProvider = new SocketProvider();
    public void connect() throws NotConnectedException, IOException,AuthenticationNotSupportedException,FtpIOException,FtpWorkflowException {        try        {            socketProvider = new SocketProvider();        }catch (IOException ioe)        {            String error = "Error creating SocketProvider: " + ioe.getMessage();            log.error(error,ioe);            throw new NotConnectedException(error);        }        // Only for logging        String hostAndPort = getAddress().getHostName() + ":" + getAddress().getPort();        try        {            socketProvider.connect(getAddress());            log.debug("connected to:" + hostAndPort);            socketProvider.socket().setSoTimeout(getTimeout());            socketProvider.socket().setKeepAlive(true);        }catch (IOException ioe)        {            String error = "Error connection to:" + hostAndPort;            log.error(error,ioe);            throw new NotConnectedException(error);        }catch (Exception e)        {        	 String error = "Couln't not connect to: " + hostAndPort;             log.error(error);             throw new NotConnectedException(error);        }        (ReplyWorker.readReply(socketProvider)).dumpReply();        Reply reply = sendCommand(new Command(Command.USER,getUser()));        reply.dumpReply();        reply.validate();        if (getPassword() != null && getPassword().length() > 0)        {            reply = sendCommand(new Command(Command.PASS, getPassword()));            reply.dumpReply();            reply.validate();        }        if (getAccount() != null && getAccount().length() > 0)        {            reply = sendCommand(new Command(Command.ACCT, getAccount()));            reply.dumpReply();            reply.validate();        }    }