[FOray-commit] SF.net SVN: foray: [7798] trunk/foray/foray-app/src/java/org/foray/app/ant
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-07-19 01:32:42
|
Revision: 7798 Author: victormote Date: 2006-07-18 18:32:33 -0700 (Tue, 18 Jul 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7798&view=rev Log Message: ----------- Remove the File version of the InputHandler constructor. Modified Paths: -------------- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java Modified: trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-07-19 01:19:40 UTC (rev 7797) +++ trunk/foray/foray-app/src/java/org/foray/app/ant/FOrayAntTaskStarter.java 2006-07-19 01:32:33 UTC (rev 7798) @@ -247,7 +247,13 @@ private void render(File foFile, File outFile) throws FOrayException { - InputHandler inputHandler = new FOInputHandler(getLogger(), foFile); + InputHandler inputHandler; + try { + inputHandler = new FOInputHandler(getLogger(), + foFile.toURL()); + } catch (MalformedURLException e) { + throw new FOrayException(e); + } XMLReader parser = inputHandler.getParser(); OutputStream out = null; Modified: trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-07-19 01:19:40 UTC (rev 7797) +++ trunk/foray/foray-app/src/java/org/foray/app/test/TestConverter.java 2006-07-19 01:32:33 UTC (rev 7798) @@ -268,7 +268,7 @@ FOrayDocument document = null; if (xsl == null) { InputHandler inputHandler = null; - inputHandler = new FOInputHandler(log, xmlFile); + inputHandler = new FOInputHandler(log, xmlFile.toURL()); XMLReader parser = inputHandler.getParser(); setParserFeatures(parser); document = new FOrayDocument(session, Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-07-19 01:19:40 UTC (rev 7797) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoAWTViewer.java 2006-07-19 01:32:33 UTC (rev 7798) @@ -98,7 +98,7 @@ return new SecureResourceBundle(url.openStream(), getLogger()); } - public void viewFO(File fo) throws IOException, FOrayException, + public void viewFO(URL fo) throws IOException, FOrayException, TransformerException { //Setup l18n String language = System.getProperty("user.language"); @@ -166,7 +166,7 @@ app.getLogger().info("Starting AWT Viewer..."); try { - app.viewFO(fofile); + app.viewFO(fofile.toURL()); app.getLogger().info("Success!"); } catch (Exception e) { app.getLogger().error("Demo AWT Viewer Error", e); Modified: trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-07-19 01:19:40 UTC (rev 7797) +++ trunk/foray/foray-app/src/java/org/foray/demo/embed/DemoFO2PDF.java 2006-07-19 01:32:33 UTC (rev 7798) @@ -40,13 +40,14 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.net.URL; /** * This class demonstrates the conversion of an FO file to PDF using FOray. */ public class DemoFO2PDF extends EmbedDemo { - public void convertFO2PDF(File fo, File pdf) throws IOException, + public void convertFO2PDF(URL fo, File pdf) throws IOException, FOrayException { // Setup FOraySession @@ -91,7 +92,7 @@ app.getLogger().info("Transforming..."); try { - app.convertFO2PDF(fofile, pdffile); + app.convertFO2PDF(fofile.toURL(), pdffile); } catch (Exception e) { app.getLogger().error("Demo FO to PDF Error", e); Modified: trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java =================================================================== --- trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-07-19 01:19:40 UTC (rev 7797) +++ trunk/foray/foray-app/src/java/org/foray/demo/servlet/AbstractDemoServlet.java 2006-07-19 01:32:33 UTC (rev 7798) @@ -27,6 +27,7 @@ import org.foray.app.FOraySpecific; import org.foray.app.OutputTargetFactory; import org.foray.common.Logging; +import org.foray.common.url.URLFactory; import org.foray.core.FOInputHandler; import org.foray.core.FOrayDocument; import org.foray.core.FOrayException; @@ -42,6 +43,7 @@ import java.io.File; import java.io.IOException; import java.io.PrintWriter; +import java.net.URL; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -75,7 +77,7 @@ String xslParam = request.getParameter(XSL_REQUEST_PARAM); if (foParam != null) { - File fofile = new File(foParam); + URL fofile = URLFactory.createURL(foParam); FOInputHandler inputHandler = new FOInputHandler(this.logger, fofile); renderFO(inputHandler, response); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |