Hi Team,
I want to read the file in java.
we know only the relative path of the file.
Example: i have one file in D drive example folder.
../../sample.xml
How can i read the sample.xml file?
Please let me know if anyone knows.
Thanks,
Sravani
Printable View
Hi Team,
I want to read the file in java.
we know only the relative path of the file.
Example: i have one file in D drive example folder.
../../sample.xml
How can i read the sample.xml file?
Please let me know if anyone knows.
Thanks,
Sravani
Have you tried to use that path in a program? What happened?
I tested, it definitely work:
Code :File file = new File("../../test.txt"); FileInputStream fis = new FileInputStream(file); System.out.println("Size = " + fis.available()); fis.close();