Skip to Content
0
Jun 03, 2020 at 01:25 PM

How to get the home directory "/usr/sap/ljs/ " in java

112 Views

Hi Experts,

I have one Java application uploaded in HANA trail account.

here is my code.

File mydir = new File("C:\\test\\"); //Created this directory using mkdir()

String[] fileNames = mydir.list(); // threw exception java.lang.NullPointerException: while trying to get the length of a null array loaded from local variable 'fileNames' bec dir (c:test) is not the path as system looks for /usr/sap/ljs/C:\\test\\

can someone please advise how to get the temp dir+ mydir

Thanks