Iam trying to add a path (string) over an editfield in class main, the path will be taken to another class extract. After this I want to read the file with FileReader, but I got some error: file not found.
So I does some test:
- I wrote the path directly in the FileReader -> everything Okay
- I wrote a function File named sFile to get the path from class main and try to find the file behinde the path (exists). The file could be found but if FileReader trying to load the file got the same error
Code:
File sFile = new File(path);
if (sFile.exists()){
System.out.println("Found.");
System.out.println(sFile.getAbsolutePath());
try{
FileReader file = new FileReader(sFile); //db10916358-hp.sql (test file)
String[] fReadTmp = new String[10240000];//Just for testing
BufferedReader br = new BufferedReader(file);
String read = br.readLine();//Read a line