protected InputStream loadFromRelativePath(String name) { try { return super.getResourceStream(name); } catch (ResourceNotFoundException rnfex) { return null; } }
protected InputStream loadFromRelativePath(String name) { try { return super.getResourceStream(name); } catch (ResourceNotFoundException rnfex) { return null; } }
protected InputStream loadFromRelativePath(String name) { try { return super.getResourceStream(name); } catch (ResourceNotFoundException rnfex) { return null; } }
protected InputStream loadFromRelativePath(String name) { try { return super.getResourceStream(name); } catch (ResourceNotFoundException rnfex) { return null; } }
/** * Returns resource as InputStream. First calls super implementation. If resource * wasn't found, it attempts to load it from current directory or as an absolute path. * * @see org.apache.velocity.runtime.resource.loader.ResourceLoader#getResourceStream(String) */ public synchronized InputStream getResourceStream(String name) throws ResourceNotFoundException { // attempt to load using default configuration try { return super.getResourceStream(name); } catch (ResourceNotFoundException rnfex) { // attempt to load from current directory or as an absolute path try { File file = new File(name); return (file.canRead()) ? new BufferedInputStream(new FileInputStream( file.getAbsolutePath())) : null; } catch (FileNotFoundException fnfe) { throw new ResourceNotFoundException( "AbsFileResourceLoader Error: cannot find resource " + name); } } }
/** * Returns resource as InputStream. First calls super implementation. If resource * wasn't found, it attempts to load it from current directory or as an absolute path. * * @see org.apache.velocity.runtime.resource.loader.ResourceLoader#getResourceStream(String) */ public synchronized InputStream getResourceStream(String name) throws ResourceNotFoundException { // attempt to load using default configuration try { return super.getResourceStream(name); } catch (ResourceNotFoundException rnfex) { // attempt to load from current directory or as an absolute path try { File file = new File(name); return (file.canRead()) ? new BufferedInputStream(new FileInputStream( file.getAbsolutePath())) : null; } catch (FileNotFoundException fnfe) { throw new ResourceNotFoundException( "AbsFileResourceLoader Error: cannot find resource " + name); } } }
result = this.fileResourceLoader.getResourceStream(name); } else { try