Logo Search packages:      
Sourcecode: jftp version File versions  Download package

String net::sf::jftp::net::FtpConnection::getLine ( String[]  until  )  [inline]

Reads the response until line found or error. (Used internally)

Definition at line 2067 of file FtpConnection.java.

References net::sf::jftp::net::JConnection::getReader(), and jcon.

    {
        BufferedReader in = null;

        try
        {
            in = jcon.getReader();
        }
        catch(Exception ex)
        {
            Log.debug(ex.toString() + " @FtpConnection::getLine");
        }

        //String resultString = null;
        String tmp;

        while(true)
        {
            try
            {
                tmp = in.readLine();

                if(tmp == null)
                {
                    break;
                }

                Log.debug(tmp);

                if(((tmp.startsWith(NEGATIVE) || (tmp.startsWith(NEGATIVE2))) &&
                       (tmp.charAt(3) != MORE_LINES_APPENDED)) ||
                       tmp.startsWith(PROCEED))
                {
                    return tmp;
                }
                else
                {
                    for(int i = 0; i < until.length; i++)
                    {
                        if(tmp.startsWith(until[i]))
                        {
                            //if(resultString == null) resultString = tmp;
                            //else resultString = resultString + "\n" + tmp;
                            if(tmp.charAt(3) != MORE_LINES_APPENDED)
                            {
                                return tmp;
                            }
                        }
                    }
                }
            }
            catch(Exception ex)
            {
                Log.debug(ex.toString() + " @FtpConnection::getLine");

                break;
            }
        }

        return null;
    }


Generated by  Doxygen 1.6.0   Back to index