/** * Internal image loading by ClassLoader.getResourceAsStream. */ private static SwtUniversalImage loadFromClassLoader( Display display, ClassLoader classLoader, String location ) { InputStream s = null; try { s = classLoader.getResourceAsStream( location ); } catch ( Throwable t ) { log.logDebug( "Unable to load image from classloader [" + location + "]" ); } if ( s == null ) { return null; } try { return loadImage( display, s, location ); } finally { IOUtils.closeQuietly( s ); } }
/** * Internal image loading from Kettle's VFS. */ private static SwtUniversalImage loadFromSimpleVFS( Display display, String location ) { try { InputStream s = KettleVFS.getInputStream( location ); if ( s == null ) { return null; } try { return loadImage( display, s, location ); } finally { IOUtils.closeQuietly( s ); } } catch ( KettleFileException e ) { // do nothing. try to load next } return null; }
return loadImage( display, s, location ); } finally { IOUtils.closeQuietly( s );
/** * Internal image loading from Kettle's user.dir VFS. */ private static SwtUniversalImage loadFromBasedVFS( Display display, String location ) { try { FileObject imageFileObject = KettleVFS.getInstance().getFileSystemManager().resolveFile( base, location ); InputStream s = KettleVFS.getInputStream( imageFileObject ); if ( s == null ) { return null; } try { return loadImage( display, s, location ); } finally { IOUtils.closeQuietly( s ); } } catch ( FileSystemException ex ) { return null; } }