cziegeler 02/04/22 03:55:01 Modified: src/java/org/apache/cocoon/components/source URLSource.java Log: readding accidetally removed lines Revision Changes Path 1.16 +19 -1 xml-cocoon2/src/java/org/apache/cocoon/components/source/URLSource.java Index: URLSource.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/URLSource.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- URLSource.java 22 Apr 2002 10:51:51 -0000 1.15 +++ URLSource.java 22 Apr 2002 10:55:00 -0000 1.16 @@ -88,7 +88,7 @@ * Description of a source which is described by an URL. * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: URLSource.java,v 1.15 2002/04/22 10:51:51 cziegeler Exp $ + * @version CVS $Id: URLSource.java,v 1.16 2002/04/22 10:55:00 cziegeler Exp $ */ public class URLSource extends AbstractStreamSource { @@ -102,6 +102,9 @@ /** The content length */ private long contentLength; + /** Is the content html or xml? */ + private boolean isHTMLContent = false; + /** The system id */ private String systemId; @@ -131,10 +134,19 @@ super(manager); this.systemId = url.toExternalForm(); this.isFile = systemId.startsWith(FILE); + if (this.isFile == true) { + if (systemId.endsWith(".htm") || systemId.endsWith(".html")) { + this.isHTMLContent = true; + } + } this.url = url; this.gotInfos = false; } + protected boolean isHTMLContent() { + return this.isHTMLContent; + } + /** * Get the last modification date and content length of the source. * Any exceptions are ignored. @@ -255,10 +267,16 @@ out.write(postString.getBytes()); out.close(); } + if ("text/html".equals(httpCon.getContentType()) == true) { + this.isHTMLContent = true; + } input = httpCon.getInputStream(); this.connection = null; // make sure a new connection is created next time return input; } + } + if ("text/html".equals(this.connection.getContentType()) == true) { + this.isHTMLContent = true; } input = this.connection.getInputStream(); this.connection = null; // make sure a new connection is created next time
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]