tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Graham" <frankgraha...@hotmail.com>
Subject data file read quandry
Date Mon, 29 Oct 2001 05:31:28 GMT
Hi I posted an email before but it was before
I joined the mailing list so I don't know if
it got through. My problem is that I am trying
to get a bean to read in a .txt file but its
not working. Either it cant find the file, or
it wont read in the file for some reason. Its
funny cause it works fine when I tested it in
my jdk. Is there some special place in tomcat
where I should put the data file? Here is
my bean code:
package mynewdev;

import java.util.Vector;
import java.io.*;

public class DataFileReader {

public Vector vect;

public DataFileReader(){

vect = new Vector();

}

public void readfile() throws Exception {

   FileReader fr = new FileReader("DataTable.txt");
   BufferedReader br = new BufferedReader(fr);
   String s;

   while((s = br.readLine()) != null) {

   vect.addElement(s);

   }

   fr.close();

   }

public String[] getItems(){

    String as[] = new String[vect.size()];
    vect.copyInto(as);
    return as;
   }
}
Any help would be appreciated!

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message