I need to write a file - abc.xlsx to folder - error and its path is : C:\Oracle\Middleware\Oracle_Home\user_projects\domains\test2\servers\error. Now from java code how to I get access to it? Currently have included the hard coded path: C:\work\abc.xlsx. I want to get path to the server folder of weblogic in a dynamic way since when my code will be deployed it has to work there also.
FileOutputStream out;
try {
out = new FileOutputStream(new File("C:\\work\\abc.xlsx"));
workbook.write(out);
out.close();
System.out.println("abc.xlsx written successfully on disk.");
} catch (IOException e) {
e.printStackTrace();
}
}