Results 1 to 8 of 8
Hi all,
I'm trying read a file in "/app/reports/myFile" using java (new File(path)).
I'm get a exception java.io.FileNotFoundException, but the file path is correct.
File file = new File("/app/reports/myFile");
This ...
- 02-27-2009 #1Just Joined!
- Join Date
- Feb 2009
- Posts
- 3
File path using Java File
Hi all,
I'm trying read a file in "/app/reports/myFile" using java (new File(path)).
I'm get a exception java.io.FileNotFoundException, but the file path is correct.
File file = new File("/app/reports/myFile");
This work when I run the applications in windows.
File file = new File("c:\\reports\\myFile");
What's wrong ?
- 02-27-2009 #2
does the user executing the java application have read access on the file? you should check the permissions of /app, /app/reports, and /app/reports/myFile
- 02-27-2009 #3Just Joined!
- Join Date
- Feb 2009
- Posts
- 3
This code is executed with root permissions
- 02-27-2009 #4
if ls /app/reports/myFile has results, then I have no idea what your issue is, it should work, especially if the application runs as root
- 02-27-2009 #5
Are you sure the constructor is throwing that exception? Can you post your code?
- 02-28-2009 #6Just Joined!
- Join Date
- Feb 2009
- Posts
- 3
The problem was the space in the path,
"/app/reports/myFile "
Thanks!
- 07-06-2011 #7Just Joined!
- Join Date
- Jul 2011
- Posts
- 1
My problem is similar.
private static String dataItemDeffileLocation = "/opt/xmetaCMS/xmetaqa/testsuites/commonmetadata_tests/PDR_BaseLine/PSAGRaph/text_exportDataConnectionPSA.xmi";
getting following exception while accessing the file:
java.io.FileNotFoundException: /opt/xmetaCMS/xmetaqa/testsuites/commonmetadata_tests/PDR_BaseLine/PSAGRaph/text_exportDataConnectionPSA.xmi (No such file or directory)
Its having the read access.
waiting for quick solution please.
Thanks in Advance.
- 07-06-2011 #8forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,096
Hello and welcome to the forums, sgb!

This thread is well over 2 years old so I'm locking it, but do feel free to start a fresh thread of your own if you need any help with Linux.
Thank you.oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.


