/** * This implementation resolves "file:" URLs or alternatively delegates to * {@code PortletContext.getRealPath}, throwing a FileNotFoundException * if not found or not resolvable. * @see javax.portlet.PortletContext#getResource(String) * @see javax.portlet.PortletContext#getRealPath(String) */ @Override public File getFile() throws IOException { URL url = getURL(); if (ResourceUtils.isFileURL(url)) { // Proceed with file system resolution... return super.getFile(); } else { String realPath = PortletUtils.getRealPath(this.portletContext, this.path); return new File(realPath); } }
/** * This implementation resolves "file:" URLs or alternatively delegates to * <code>PortletContext.getRealPath</code>, throwing a FileNotFoundException * if not found or not resolvable. * @see javax.portlet.PortletContext#getResource(String) * @see javax.portlet.PortletContext#getRealPath(String) */ @Override public File getFile() throws IOException { URL url = getURL(); if (ResourceUtils.isFileURL(url)) { // Proceed with file system resolution... return super.getFile(); } else { String realPath = PortletUtils.getRealPath(this.portletContext, this.path); return new File(realPath); } }