private InputStream safeOpen ( String file ) { URL url = bundle . getEntry ( file ) ; if ( url != null ) { try { return url . openStream ( ) ; } catch ( IOException e ) { // if we get an IOException just return null for default page. } } return null ; }
Attempt to open the file in the bundle and return null if something goes wrong .