@Override public InputStream getResourceStream(String name, Context context) throws IOException { try { return ((Resource) context.getResources().lookup(name)).streamContent(); } catch (NamingException ex) { logger.trace("", ex); throw new RuntimeException(ex); } }
/** * Content accessor. * * @return InputStream */ public InputStream streamContent() throws IOException { if (binaryContent == null) { FileInputStream fis = new FileInputStream(file); inputStream = fis; return fis; } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ public InputStream streamContent() throws IOException { if (binaryContent == null) { FileInputStream fis = new FileInputStream(file); inputStream = fis; return fis; } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ @Override public InputStream streamContent() throws IOException { if (binaryContent == null) { FileInputStream fis = new FileInputStream(file); inputStream = fis; return fis; } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ @Override public InputStream streamContent() throws IOException { if (binaryContent == null) { FileInputStream fis = new FileInputStream(file); inputStream = fis; return fis; } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ @Override public InputStream streamContent() throws IOException { if (binaryContent == null) { FileInputStream fis = new FileInputStream(file); inputStream = fis; return fis; } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ @Override public InputStream streamContent() throws IOException { if (binaryContent == null) { FileInputStream fis = new FileInputStream(file); inputStream = fis; return fis; } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ @Override public InputStream streamContent() throws IOException { if (binaryContent == null) { FileInputStream fis = new FileInputStream(file); inputStream = fis; return fis; } return super.streamContent(); }
protected static InputStream getInputStream(Object obj) throws NamingException { InputStream in = null; if (obj instanceof Resource) { try { in = ((Resource)obj).streamContent(); } catch (IOException ex) { ; } } else if (obj instanceof InputStream) { in = (InputStream)obj; } if (in == null) { throw new NamingException("Can't get input stream"); } return in; }
public InputStream streamContent() throws IOException { if (binaryContent == null) { InputStream is = entry.openStream(); inputStream = is; return is; } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ public InputStream streamContent() throws IOException { try { if (binaryContent == null) { inputStream = base.getInputStream(entry); } } catch (ZipException e) { throw new IOException(e.getMessage()); } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ public InputStream streamContent() throws IOException { try { if (binaryContent == null) { inputStream = base.getInputStream(entry); } } catch (ZipException e) { throw new IOException(e.getMessage()); } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ public InputStream streamContent() throws IOException { try { if (binaryContent == null) { InputStream is = base.getInputStream(entry); inputStream = is; return is; } } catch (ZipException e) { throw new IOException(e.getMessage()); } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ @Override public InputStream streamContent() throws IOException { try { if (binaryContent == null) { InputStream is = base.getInputStream(entry); inputStream = is; return is; } } catch (ZipException e) { throw new IOException(e.getMessage()); } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ public InputStream streamContent() throws IOException { try { if (binaryContent == null) { InputStream is = base.getInputStream(entry); inputStream = is; return is; } } catch (ZipException e) { throw new IOException(e.getMessage()); } return super.streamContent(); }
/** * Content accessor. * * @return InputStream */ @Override public InputStream streamContent() throws IOException { try { if (binaryContent == null) { InputStream is = base.getInputStream(entry); inputStream = is; return is; } } catch (ZipException e) { throw new IOException(e.getMessage()); } return super.streamContent(); }
/** * Get input stream. */ public InputStream getInputStream() throws IOException { if (!connected) connect(); if (resource == null) { throw new FileNotFoundException(); } else { // Reopen resource try { resource = (Resource) context.lookup(localPath); } catch (NamingException e) { } } return (resource.streamContent()); }
/** * Get input stream. */ public InputStream getInputStream() throws IOException { if (!connected) connect(); if (resource == null) { throw new FileNotFoundException(); } else { // Reopen resource try { resource = (Resource) context.lookup(localPath); } catch (NamingException e) { } } return (resource.streamContent()); }
/** * Get input stream. */ @Override public InputStream getInputStream() throws IOException { if (!connected) connect(); if (resource == null) { throw new FileNotFoundException(); } // Reopen resource try { resource = (Resource) context.lookup(getURL().getFile()); } catch (NamingException e) { // Ignore } return (resource.streamContent()); }
/** * Get input stream. */ @Override public InputStream getInputStream() throws IOException { if (!connected) connect(); if (resource == null) { throw new FileNotFoundException(); } // Reopen resource try { resource = (Resource) context.lookup(getURL().getFile()); } catch (NamingException e) { // Ignore } return (resource.streamContent()); }