[Yanel-commits] rev 42748 - public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/collection

michi at wyona.com michi at wyona.com
Fri May 8 22:40:38 CEST 2009


Author: michi
Date: 2009-05-08 22:40:38 +0200 (Fri, 08 May 2009)
New Revision: 42748

Modified:
   public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/collection/CollectionResource.java
Log:
slightly refactored such that it is clearer what code belongs together

Modified: public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/collection/CollectionResource.java
===================================================================
--- public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/collection/CollectionResource.java	2009-05-08 20:39:39 UTC (rev 42747)
+++ public/yanel/trunk/src/resources/directory/src/java/org/wyona/yanel/impl/resources/collection/CollectionResource.java	2009-05-08 20:40:38 UTC (rev 42748)
@@ -125,10 +125,8 @@
 
     public View getXMLView(String viewId, InputStream xmlInputStream) throws Exception {
         if (viewId == null || !viewId.equals("source")) {
-            java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
             TransformerFactory tfactory = TransformerFactory.newInstance();
             Transformer transformerIntern = tfactory.newTransformer(getXSLTStreamSource());
-            StreamSource orig = new StreamSource(xmlInputStream);
 
             transformerIntern.setParameter("yanel.path.name", org.wyona.commons.io.PathUtil.getName(getPath()));
             transformerIntern.setParameter("yanel.path", getPath().toString());
@@ -136,7 +134,10 @@
             transformerIntern.setParameter("yarep.back2realm", backToRoot());
             transformerIntern.setParameter("yarep.parent", getParent(getPath()));
             transformerIntern.setParameter("yanel.htdocs", PathUtil.getGlobalHtdocsPath(this));
-            transformerIntern.transform(orig, new StreamResult(baos));
+
+            java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
+            transformerIntern.transform(new StreamSource(xmlInputStream), new StreamResult(baos));
+
             return super.getXMLView(viewId, new java.io.ByteArrayInputStream(baos.toByteArray()));
         }
         return super.getXMLView(viewId, xmlInputStream);



More information about the Yanel-commits mailing list