code: public static FileInputStream getFileIputStream(final File file) throws FileNotFoundException {
          try {
              return AccessController.doPrivileged(
                                                   new PrivilegedExceptionAction<FileInputStream>() {
                                                       @Override
                                                       public FileInputStream run() throws FileNotFoundException {
                                                           return new FileInputStream(file);
                                                       }
                                                   });
          } catch (PrivilegedActionException e) {
              // Creating a FileOutputStream can only return a FileNotFoundException
              throw (FileNotFoundException) e.getCause();
          }
      }
docs: Java 2 security APIs for FileInputStream