pbwest 2004/03/15 22:49:35 Modified: src/java/org/apache/fop/apps Tag: FOP_0-20-0_Alt-Design InputHandler.java FOFileHandler.java XSLTInputHandler.java src/java/org/apache/fop/configuration Tag: FOP_0-20-0_Alt-Design FOUserAgent.java Log: Synchronized changes to base URL handling from HEAD. Revision Changes Path No revision No revision 1.4.2.7 +26 -1 xml-fop/src/java/org/apache/fop/apps/InputHandler.java Index: InputHandler.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/InputHandler.java,v retrieving revision 1.4.2.6 retrieving revision 1.4.2.7 diff -u -r1.4.2.6 -r1.4.2.7 --- InputHandler.java 8 Mar 2004 21:02:27 -0000 1.4.2.6 +++ InputHandler.java 16 Mar 2004 06:49:35 -0000 1.4.2.7 @@ -41,6 +41,31 @@ */ public abstract InputSource getInputSource(); + protected String baseURL = null; + + /** + * Get the base URL associated with this input source + * @return the input source + */ + public String getBaseURL() { + return baseURL; + } + + /** + * Attempts to set a default base URL from the parent of the file passed + * as an argument. Sets <code>baseURL</code> to the URL derived, or to an + * empty string if that fails. + * @param file + */ + protected void setBaseURL(File file) { + try { + baseURL = + new File(file.getAbsolutePath()).getParentFile().toURL().toExternalForm(); + } catch (Exception e) { + baseURL = ""; + } + } + /** * Get the SAX parser associated with this input handler. * @return the SAX parser 1.2.2.3 +2 -1 xml-fop/src/java/org/apache/fop/apps/FOFileHandler.java Index: FOFileHandler.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/FOFileHandler.java,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -u -r1.2.2.2 -r1.2.2.3 --- FOFileHandler.java 8 Mar 2004 21:02:27 -0000 1.2.2.2 +++ FOFileHandler.java 16 Mar 2004 06:49:35 -0000 1.2.2.3 @@ -39,6 +39,7 @@ */ public FOFileHandler(File fofile) { this.fofile = fofile; + setBaseURL(fofile); } /** 1.12.2.3 +2 -0 xml-fop/src/java/org/apache/fop/apps/XSLTInputHandler.java Index: XSLTInputHandler.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/XSLTInputHandler.java,v retrieving revision 1.12.2.2 retrieving revision 1.12.2.3 diff -u -r1.12.2.2 -r1.12.2.3 --- XSLTInputHandler.java 8 Mar 2004 21:02:27 -0000 1.12.2.2 +++ XSLTInputHandler.java 16 Mar 2004 06:49:35 -0000 1.12.2.3 @@ -55,6 +55,7 @@ public XSLTInputHandler(File xmlfile, File xsltfile, Vector params) { this.xmlSource = new StreamSource(xmlfile); this.xsltSource = new StreamSource(xsltfile); + setBaseURL(xmlfile); xsltParams = params; } @@ -67,6 +68,7 @@ public XSLTInputHandler(File xmlfile, File xsltfile) { this.xmlSource = new StreamSource(xmlfile); this.xsltSource = new StreamSource(xsltfile); + setBaseURL(xmlfile); } /** No revision No revision 1.1.2.2 +3 -6 xml-fop/src/java/org/apache/fop/configuration/Attic/FOUserAgent.java Index: FOUserAgent.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/configuration/Attic/FOUserAgent.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- FOUserAgent.java 13 Mar 2004 08:41:29 -0000 1.1.2.1 +++ FOUserAgent.java 16 Mar 2004 06:49:35 -0000 1.1.2.2 @@ -20,11 +20,9 @@ // Java import java.util.Map; +import java.util.logging.Logger; import java.io.InputStream; -// Avalon -import org.apache.avalon.framework.logger.LogEnabled; -import org.apache.avalon.framework.logger.Logger; /** * The User Agent for fo. @@ -46,7 +44,7 @@ * These areas may contain resolveable areas that will be processed * with other resolveable areas */ -public class FOUserAgent implements LogEnabled { +public class FOUserAgent { private Logger log; /** Map containing various default values */ @@ -59,7 +57,6 @@ /** * Sets the logger. * @param log Logger to use - * @see org.apache.avalon.framework.logger.LogEnabled#enableLogging(Logger) */ public void enableLogging(Logger log) { this.log = log;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]