Accessing linux local file system from java web application
问题 we are using a java library inside a web application which is hosted in apache server.ReadConfFile method in library returns file not found error.The method is as follows public byte[] ReadConfFile() { try { File file = new File("/home/product/api/conf.txt"); if(!file.exists()) return "file not found".getBytes(); byte[] buf = new byte[(int) file.length()]; FileInputStream fis = new FileInputStream(file); fis.read(buf); return buf; } catch (IOException e) { e.printStackTrace(); return null; }