6 public class FileParse {
\r
12 protected String type;
\r
13 protected BufferedReader dataIn;
\r
15 public FileParse() {}
\r
17 public FileParse(String fileStr, String type) throws MalformedURLException, IOException
\r
22 if (type.equals("File")) {
\r
23 this.inFile = new File(fileStr);
\r
24 this.fileSize = (int)inFile.length();
\r
26 dataIn = new BufferedReader(new FileReader( fileStr ));
\r
28 } else if (type.equals("URL")) {
\r
29 URL url = new URL(fileStr);
\r
31 dataIn = new BufferedReader(new InputStreamReader( url.openStream() ));
\r
32 } else if(type.equals("Paste"))
\r
34 dataIn = new BufferedReader(new StringReader(fileStr));
\r
38 public String nextLine() throws IOException {
\r
39 String next = dataIn.readLine();
\r