File file = new File(externalContext.getRealPath("") + imagePath); inputStream = new FileInputStream(file);
@Override public String getRealPath(String path) { return wrapped.getRealPath(path); }
/** * @see Faces#getRealPath(String) */ public static String getRealPath(FacesContext context, String webContentPath) { return context.getExternalContext().getRealPath(webContentPath); }
ExternalContext externalContext = facesContext.getExternalContext(); String realPath = externalContext.getRealPath("/WEB-INF/config.xml"); FileOutputStream output = new FileOutputStream(realPath); // ...
/** * @see Faces#getRealPath(String) */ public static String getRealPath(FacesContext context, String webContentPath) { return context.getExternalContext().getRealPath(webContentPath); }
ExternalContext ext = FacesContext.getCurrentInstance().getExternalContext(); String resourcesPath = ext.getRealPath("/WEB-INF/resources"); File hmmFile = new File(resourcesPath + "/pos-en-bio-medpost.HiddenMarkovModel");
/** * @since JSF 2.0 */ public String getRealPath(String path) { ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get(); if (ctx == null) { throw new UnsupportedOperationException(); } return ctx.getRealPath(path); }
/** * @param target * @param fileName * @return */ public static String getAbsolutePath( String target, String fileName ) { if ( target == null ) { target = ""; } if ( !target.endsWith( "/" ) ) { target += "/"; } return FacesContext.getCurrentInstance().getExternalContext().getRealPath( target + fileName ); }
/** * <p class="changed_added_2_0">Returns a String containing the real * path for a given virtual path. </p> * * <div class="changed_added_2_0"> * * <p><em>Servlet:</em> This must be the value returned by the * <code>javax.servlet.ServletContext</code> method * <code>getRealPath()</code>.</p> * * <p>The default implementation throws * <code>UnsupportedOperationException</code> and is provided * for the sole purpose of not breaking existing applications that extend * this class.</p> * * </div> * * @param path The context of the requested initialization parameter * * @since 2.0 */ public String getRealPath(String path) { if (defaultExternalContext != null) { return defaultExternalContext.getRealPath(path); } throw new UnsupportedOperationException(); }
@Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
/** * <p>The default behavior of this method is to * call {@link ExternalContext#getRealPath(String)} * on the wrapped {@link ExternalContext} object.</p> * * @see javax.faces.context.ExternalContext#getRealPath(String) */ @Override public String getRealPath(String path) { return getWrapped().getRealPath(path); }
final FacesContext context = FacesContext.getCurrentInstance(); ClassicEngineBoot.getInstance().start(); try { // load report definition ResourceManager manager = new ResourceManager(); manager.registerDefaults(); ExternalContext extContext = context.getExternalContext(); String reportPath = "file:" + extContext.getRealPath("name/name.prpt"); Resource res = manager.createDirectly(new URL(reportPath), MasterReport.class); MasterReport report = (MasterReport) res.getResource(); ................ ................ httpServletResponse.setContentType("application/rtf"); httpServletResponse.setHeader("Content-Disposition", "attachment; filename=\"name.rtf\""); RTFReportUtil.createRTF(report, httpServletResponse.getOutputStream()); FacesContext.getCurrentInstance().responseComplete(); } catch (ReportProcessingException ex) {