You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2001/05/31 15:17:51 UTC
cvs commit: xml-cocoon2/src/org/apache/cocoon/generation DirectoryGenerator.java FileGenerator.java
cziegeler 01/05/31 06:17:50
Modified: src/org/apache/cocoon/environment Source.java
src/org/apache/cocoon/generation DirectoryGenerator.java
FileGenerator.java
Log:
Update Source to create an correctly initialised InputSource object with InputStream and SystemID for use with other components, e.g. the parser
Revision Changes Path
1.6 +12 -11 xml-cocoon2/src/org/apache/cocoon/environment/Source.java
Index: Source.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Source.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Source.java 2001/05/31 13:05:23 1.5
+++ Source.java 2001/05/31 13:17:41 1.6
@@ -24,7 +24,7 @@
* for accessing any resource (URL, local file etc).
*
* @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.5 $ $Date: 2001/05/31 13:05:23 $
+ * @version CVS $Revision: 1.6 $ $Date: 2001/05/31 13:17:41 $
*/
public final class Source {
@@ -122,16 +122,6 @@
}
/**
- * Return an <code>InputSource</code> object to read from the source.
- */
- public InputSource getInputSource()
- throws IOException {
- InputSource source = new InputSource(getInputStream());
- source.setSystemId(getSystemId());
- return source;
- }
-
- /**
* Return the unique identifer for this source
*/
public String getSystemId() {
@@ -166,5 +156,16 @@
this.connection = null;
this.gotInfos = false;
}
+
+ /**
+ * Return a new <code>InputSource</code> object
+ */
+ public InputSource getInputSource()
+ throws IOException {
+ InputSource newObject = new InputSource(this.getInputStream());
+ newObject.setSystemId(this.systemId);
+ return newObject;
+ }
+
}
1.5 +1 -2 xml-cocoon2/src/org/apache/cocoon/generation/DirectoryGenerator.java
Index: DirectoryGenerator.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/DirectoryGenerator.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DirectoryGenerator.java 2001/05/23 12:32:17 1.4
+++ DirectoryGenerator.java 2001/05/31 13:17:45 1.5
@@ -25,7 +25,6 @@
import org.apache.avalon.excalibur.pool.Recyclable;
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
@@ -64,7 +63,7 @@
* (Apache Software Foundation, Exoffice Technologies)
* @author <a href="mailto:conny@smb-tec.com">Conny Krappatsch</a>
* (SMB GmbH) for Virbus AG
- * @version CVS $Revision: 1.4 $ $Date: 2001/05/23 12:32:17 $ */
+ * @version CVS $Revision: 1.5 $ $Date: 2001/05/31 13:17:45 $ */
public class DirectoryGenerator extends ComposerGenerator implements Recyclable {
1.8 +2 -3 xml-cocoon2/src/org/apache/cocoon/generation/FileGenerator.java
Index: FileGenerator.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/FileGenerator.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FileGenerator.java 2001/05/31 13:05:27 1.7
+++ FileGenerator.java 2001/05/31 13:17:47 1.8
@@ -26,7 +26,6 @@
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.util.HashUtil;
import org.apache.avalon.excalibur.pool.Recyclable;
-import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
@@ -39,7 +38,7 @@
* @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
* @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.7 $ $Date: 2001/05/31 13:05:27 $
+ * @version CVS $Revision: 1.8 $ $Date: 2001/05/31 13:17:47 $
*/
public class FileGenerator extends ComposerGenerator
implements Cacheable, Recyclable {
@@ -113,7 +112,7 @@
parser = (Parser)this.manager.lookup(Roles.PARSER);
parser.setConsumer(super.xmlConsumer);
- parser.parse(inputSource.getInputSource());
+ parser.parse(this.inputSource.getInputSource());
} catch (IOException e) {
getLogger().error("FileGenerator.generate()", e);
throw new ResourceNotFoundException("FileGenerator could not find resource", e);
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org