Back to index

wims  3.65+svn20090927
Answer.java
Go to the documentation of this file.
00001 /*
00002  * Created on 20.07.2005
00003  *
00004  */
00005 package rene.util.ftp;
00006 
00007 import java.io.BufferedReader;
00008 import java.io.IOException;
00009 
00010 class Answer
00011 {      int Code;
00012        String Text;
00013        public void get (BufferedReader in) throws IOException
00014        {      String s=in.readLine();
00015               String CodeString=s.substring(0,3);
00016               Code=Integer.parseInt(CodeString);
00017               Text=s.substring(4);
00018               if (s.charAt(3)=='-')
00019               {      while (true)
00020                      {      s=in.readLine();
00021                             if (s.startsWith(CodeString))
00022                             {      Text=Text+"\n"+s.substring(4);
00023                                    break;
00024                             }
00025                             Text=Text+"\n"+s;
00026                      }
00027               }
00028        }
00029        int code () { return Code; }
00030        String text () { return Text; }
00031 }