I have gone through the articles which are shared above, but we are still getting null pointer exception while trying to read a file from shared location (we are running service file manual to create WO and attach the file as i don't have access to the shared location). Below are the codes we are using to read file details.
final String filename = tools.getParameterPage().getString("FileName");
java.io.FileInputStream fis = new java.io.FileInputStream(filename);
java.io.InputStream inputStream = new java.io.FileInputStream(filename);
byte buffer = new byte[inputStream.available()];