Witam otóż potrzebuję aby aplikacja spakowana w .jar edytowała plik tekstowy znajdujący się poza nim.
public String[] getRecords(boolean sort) throws FileNotFoundException, IOException
{
log.entering(getClass().getName(), "getRecords");
ArrayList<String> array = new ArrayList<String>();
BufferedReader br = new BufferedReader(new FileReader(fileName));
String line=br.readLine();
while(line != null)
{
array.add(line);
line=br.readLine();
}
String[] tab = new String[array.size()];
array.toArray(tab);
br.close();
if(sort) Arrays.sort(tab);
log.exiting(getClass().getName(), "getRecords");
return tab;
}
Plik .jar i dany plik .txt znajduja sie w tym samym folderze. Mimo to aplikacja nie widzi tego txt.
fileName=book.txt