@Override public URL getResource(String path) throws MalformedURLException { return wrapped.getResource(path); }
@Override public File getBaseDirectory() { PortletContext context = getPortletContext(); String resultPath = context.getRealPath("/"); if (resultPath != null) { return new File(resultPath); } else { try { final URL url = context.getResource("/"); return new File(url.getFile()); } catch (final Exception e) { // FIXME: Handle exception getLogger().log(Level.INFO, "Cannot access base directory, possible security issue " + "with Application Server or Servlet Container", e); } } return null; }
@Override public URL getResource(String s) throws MalformedURLException { return mPortletContext.getResource(s); }
public URL resolve(String uri) { try { return context.getResource(uri); } catch (MalformedURLException e) { return null; } } };
public URL resolve(String uri) { try { return context.getResource(uri); } catch (MalformedURLException e) { return null; } } };
/** * @see javax.servlet.ServletContext#getResource(String) */ public URL getResource(String arg0) throws MalformedURLException { return portletContext.getResource(arg0); }
@Override public URL getResource(String path) throws MalformedURLException { return portletContext.getResource(path); }
/** {@inheritDoc} */ public URL getResource(String path) throws IOException { return context.getResource(path); }
/** * This implementation checks <code>PortletContext.getResource</code>. * @see javax.portlet.PortletContext#getResource(String) */ @Override public boolean exists() { try { URL url = this.portletContext.getResource(this.path); return (url != null); } catch (MalformedURLException ex) { return false; } }
/** * This implementation checks {@code PortletContext.getResource}. * @see javax.portlet.PortletContext#getResource(String) */ @Override public boolean exists() { try { URL url = this.portletContext.getResource(this.path); return (url != null); } catch (MalformedURLException ex) { return false; } }
@Override public URL getResource(String path) throws MalformedURLException { return portletContext.getResource(path); }
public URL getResource(String url) throws Exception { String path = removeScheme(url); return pcontext_.getResource(path); }
@Override public URL getResource(String path) throws MalformedURLException { checkNull(path, "path"); return _portletContext.getResource(path); }
/** * {@inheritDoc} * * @see org.xwiki.container.ApplicationContext#getResource(String) */ public URL getResource(String resourceName) throws MalformedURLException { return getPortletContext().getResource(resourceName); }
@Override protected URL doGetResource(String path) throws IOException { String realPath = portletContext.getRealPath(path); if (realPath != null) { return new File(realPath).toURI().toURL(); } else { return portletContext.getResource(path); } }
/** * This implementation delegates to {@code PortletContext.getResource}, * but throws a FileNotFoundException if no resource found. * @see javax.portlet.PortletContext#getResource(String) */ @Override public URL getURL() throws IOException { URL url = this.portletContext.getResource(this.path); if (url == null) { throw new FileNotFoundException( getDescription() + " cannot be resolved to URL because it does not exist"); } return url; }
@Override protected URL doGetResource(String path) throws IOException { String realPath = portletContext.getRealPath(path); if (realPath != null) { return new File(realPath).toURI().toURL(); } else { return portletContext.getResource(path); } }
public URL getResource(String path) throws MalformedURLException { return getWrapped().getResource(path); }
public URL getResource(String path) throws MalformedURLException { return getWrapped().getResource(path); }
private void renderView(String viewName, RenderRequest req, RenderResponse res) throws PortletException, MalformedURLException { res.setContentType(req.getResponseContentType()); String viewPath = settings.getValue(Settings.Entry.VIEW_PREFIX) + viewName + settings.getValue(Settings.Entry.VIEW_SUFFIX); URL url = getPortletConfig().getPortletContext().getResource(viewPath); if (url == null) { // This won't work at all... String msg = "The specified viewPath is not found: " + viewPath; throw new RuntimeException(msg); } runScript(url, req, res); }