Hello I have written a such function under Eclipse:
public static ArrayList<String> getMails(){
ArrayList<String> mails = new ArrayList<String>();
try{
FileInputStream fstream = new FileInputStream("mails.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
mails.add(strLine.trim());
}
in.close();
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());
}
return mails;
}
The mails.txt file is under workspace/projectname , I want to keep this item under the workspace/projectname/bin/ directory, as a relative path so whenever I copy the workspace/projectname//bin directory to some other location or computer, let it work. However when I try this, I get "FileNotFound" exception. How can I fix this ? Thanks