Author: mir
Date: Sat Feb  6 00:46:55 2010
New Revision: 907143

URL: http://svn.apache.org/viewvc?rev=907143&view=rev
Log:
CLEREZZA-69: content length response header now set when the first bytes has 
been received. Renamed classes.

Added:
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ContentLengthSettingByteChannel.java
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java
      - copied, changed from r907114, 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannel.java
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlConvertingBody.java
      - copied, changed from r907114, 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlSettingBody.java
Removed:
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannel.java
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlSettingBody.java
Modified:
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ResponseStatusInfo.java
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannel.java
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/WrappedResponse.java
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlFilter.java
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java
    
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannelTest.java

Added: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ContentLengthSettingByteChannel.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ContentLengthSettingByteChannel.java?rev=907143&view=auto
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ContentLengthSettingByteChannel.java
 (added)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ContentLengthSettingByteChannel.java
 Sat Feb  6 00:46:55 2010
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.clerezza.platform.xhtml2html;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.WritableByteChannel;
+import org.wymiwyg.wrhapi.HandlerException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Triggers the CONTENT-LENGTH header to be set in the wrapped response when 
the
+ * first bytes are written to the <code>WritableByteChannel</code> and the 
content
+ * (to be written to the channel) will not to be converted from xhtml to html.
+ * 
+ * @author mir
+ */
+class ContentLengthSettingByteChannel implements WritableByteChannel {
+
+       final static private Logger logger = 
LoggerFactory.getLogger(ContentLengthSettingByteChannel.class);
+       private WrappedResponse wrappedResponse;
+       private WritableByteChannel wrappedByteChannel;
+       private boolean contetLengthIsSet = false;
+
+       ContentLengthSettingByteChannel(WritableByteChannel byteChannel,
+                       WrappedResponse wrappedResponse) {
+               this.wrappedByteChannel = byteChannel;
+               this.wrappedResponse = wrappedResponse;
+       }
+
+       @Override
+       public int write(ByteBuffer bb) throws IOException {
+               if (!contetLengthIsSet && bb.remaining() > 0) {
+                       try {
+                               
wrappedResponse.setContentLengthIfNoConversion();
+                               contetLengthIsSet = true;
+                       } catch (HandlerException ex) {
+                               logger.error("Exception {}", ex.toString(), ex);
+                       }
+               }
+               return wrappedByteChannel.write(bb);
+       }
+
+       @Override
+       public boolean isOpen() {
+               return wrappedByteChannel.isOpen();
+
+
+
+
+       }
+
+       @Override
+       public void close() throws IOException {
+               wrappedByteChannel.close();
+
+
+       }
+}

Copied: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java
 (from r907114, 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannel.java)
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java?p2=incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java&p1=incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannel.java&r1=907114&r2=907143&rev=907143&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannel.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java
 Sat Feb  6 00:46:55 2010
@@ -28,7 +28,7 @@
  *
  * @author mir
  */
-class DocTypeSettingByteChannel implements WritableByteChannel {
+class DocTypeFilteringByteChannel implements WritableByteChannel {
        
        private final static byte[] DOCTYPE_DEF_BYTES = "<!DOCTYPE html PUBLIC 
\"-//W3C//DTD XHTML 1.0 Strict//EN\" 
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";> ".getBytes();
        private final static byte[] DOCTYPE_TAG_BYTES = "<!DOCTYPE".getBytes();
@@ -45,7 +45,7 @@
        private boolean isXmlDeclaration = true;
        private boolean isNotADoctypeDef = false;
        
-       public DocTypeSettingByteChannel(WritableByteChannel byteChannel, 
+       public DocTypeFilteringByteChannel(WritableByteChannel byteChannel,
                        ResponseStatusInfo wrappedResponse) {
                this.wrappedByteChannel = byteChannel;
                this.wrappedResponse = wrappedResponse;
@@ -53,7 +53,7 @@
 
        @Override
        public int write(ByteBuffer byteBuffer) throws IOException {
-               if (!doctypeWritten && wrappedResponse.isHtml()) {
+               if (!doctypeWritten && wrappedResponse.convertXhtml2Html()) {
                        int initialRemaining = byteBuffer.remaining();
                        while (byteBuffer.remaining() > 0) {
                                byte b = byteBuffer.get();

Modified: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ResponseStatusInfo.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ResponseStatusInfo.java?rev=907143&r1=907142&r2=907143&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ResponseStatusInfo.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/ResponseStatusInfo.java
 Sat Feb  6 00:46:55 2010
@@ -20,14 +20,15 @@
 
 /**
  *
- * @author reto
+ * @author reto, mir
  */
 interface ResponseStatusInfo {
 
        /**
         *
-        * @return true if the response is known to be (x)html, false otherwise
+        * @return true if the content of the response has to be converted from
+        *              xhtml to html, false otherwise
         */
-       boolean isHtml();
+       boolean convertXhtml2Html();
 
 }

Modified: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannel.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannel.java?rev=907143&r1=907142&r2=907143&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannel.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannel.java
 Sat Feb  6 00:46:55 2010
@@ -74,7 +74,7 @@
 
        @Override
        public int write(ByteBuffer byteBuffer) throws IOException {
-               if (responseStatusInfo.isHtml()) {
+               if (responseStatusInfo.convertXhtml2Html()) {
                        int bytesWritten = byteBuffer.remaining();
                        while (byteBuffer.remaining() > 0) {
                                byte b = byteBuffer.get();
@@ -86,13 +86,11 @@
                                                break;
 
                                        case DETERMINE_IF_IS_OPENING_TAG:
-                                               if (status == 
Status.DETERMINE_IF_IS_OPENING_TAG) {
-                                                       if (b != SLASH) {
-                                                               status = 
Status.READ_TAG_NAME;
-                                                       } else {
-                                                               status = 
Status.SEARCH_TAG;
-                                                               break;
-                                                       }
+                                               if (b != SLASH) {
+                                                       status = 
Status.READ_TAG_NAME;
+                                               } else {
+                                                       status = 
Status.SEARCH_TAG;
+                                                       break;
                                                }
                                        case READ_TAG_NAME:
                                                if (b == SPACE) {

Modified: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/WrappedResponse.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/WrappedResponse.java?rev=907143&r1=907142&r2=907143&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/WrappedResponse.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/WrappedResponse.java
 Sat Feb  6 00:46:55 2010
@@ -33,19 +33,17 @@
 class WrappedResponse extends ResponseWrapper implements ResponseStatusInfo {
        private String XHTML_TYPE = "application/xhtml+xml";
        private String HTML_TYPE = "text/html";
-       private boolean isHtml = false;
+       private boolean convertXhtml2Html = false;
        private List<Object> contentLengths = new ArrayList<Object>();
 
        public WrappedResponse(Response response) {
                super(response);
        }
 
-
-
        @Override
        public void addHeader(HeaderName headerName, Object value) throws 
HandlerException {
                if (headerName.equals(HeaderName.CONTENT_LENGTH)) {
-                       if (isHtml) {
+                       if (convertXhtml2Html) {
                                // do nothing
                        } else {
                                contentLengths.add(value);
@@ -54,7 +52,7 @@
                }
                if (headerName.equals(HeaderName.CONTENT_TYPE) && 
XHTML_TYPE.equals(value)) {
                        super.addHeader(headerName, HTML_TYPE);
-                       isHtml = true;
+                       convertXhtml2Html = true;
                } else {
                        super.addHeader(headerName, value);
                }
@@ -63,7 +61,7 @@
        @Override
        public void setHeader(HeaderName headerName, Object value) throws 
HandlerException {
                if (headerName.equals(HeaderName.CONTENT_LENGTH)) {
-                       if (isHtml) {
+                       if (convertXhtml2Html) {
                                // do nothing
                        } else {
                                contentLengths.clear();
@@ -73,7 +71,7 @@
                }
                if (headerName.equals(HeaderName.CONTENT_TYPE) && 
XHTML_TYPE.equals(value)) {
                        super.setHeader(headerName, HTML_TYPE);
-                       isHtml = true;
+                       convertXhtml2Html = true;
                } else {
                        super.setHeader(headerName, value);
                }
@@ -81,16 +79,16 @@
 
        @Override
        public void setBody(MessageBody body) throws HandlerException {
-               super.setBody(new Xhtml2HtmlSettingBody(body, this));
+               super.setBody(new Xhtml2HtmlConvertingBody(body, this));
        }
 
        @Override
-       public boolean isHtml() {
-               return isHtml;
+       public boolean convertXhtml2Html() {
+               return convertXhtml2Html;
        }
 
-       void setContentLengthIfNotHtml() throws HandlerException {
-               if (contentLengths.size() > 0 && !isHtml) {
+       void setContentLengthIfNoConversion() throws HandlerException {
+               if (contentLengths.size() > 0 && !convertXhtml2Html) {
                        super.setHeader(HeaderName.CONTENT_LENGTH, 
contentLengths.toArray());
                }
        }

Copied: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlConvertingBody.java
 (from r907114, 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlSettingBody.java)
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlConvertingBody.java?p2=incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlConvertingBody.java&p1=incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlSettingBody.java&r1=907114&r2=907143&rev=907143&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlSettingBody.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlConvertingBody.java
 Sat Feb  6 00:46:55 2010
@@ -16,7 +16,6 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.clerezza.platform.xhtml2html;
 
 import java.io.IOException;
@@ -26,14 +25,14 @@
 
 /**
  *
- * @author tio
+ * @author mir
  */
-class Xhtml2HtmlSettingBody extends MessageBody2Write {
+class Xhtml2HtmlConvertingBody extends MessageBody2Write {
 
        private WrappedResponse wrappedResponse;
        private MessageBody body;
 
-       public Xhtml2HtmlSettingBody(MessageBody body, WrappedResponse 
wrappedResponse) {
+       public Xhtml2HtmlConvertingBody(MessageBody body, WrappedResponse 
wrappedResponse) {
                this.wrappedResponse = wrappedResponse;
                this.body = body;
        }
@@ -41,8 +40,8 @@
        @Override
        public void writeTo(WritableByteChannel byteChannel)
                        throws IOException {
-               body.writeTo(new DocTypeSettingByteChannel(
+               body.writeTo(new ContentLengthSettingByteChannel(new 
DocTypeFilteringByteChannel(
                                new SelfClosing2ClosingTagsByteChannel(
-                               byteChannel, wrappedResponse), 
wrappedResponse));
+                               byteChannel, wrappedResponse), 
wrappedResponse), wrappedResponse));
        }
 }

Modified: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlFilter.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlFilter.java?rev=907143&r1=907142&r2=907143&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlFilter.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/Xhtml2HtmlFilter.java
 Sat Feb  6 00:46:55 2010
@@ -51,9 +51,7 @@
                if (!isApplicable(request)) {
                        handler.handle(request, response);
                } else {
-                       WrappedResponse wrappedResponse = new 
WrappedResponse(response);
-                       handler.handle(new WrappedRequest(request), 
wrappedResponse);
-                       wrappedResponse.setContentLengthIfNotHtml();
+                       handler.handle(new WrappedRequest(request), new 
WrappedResponse(response));
                }
        }
 

Modified: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java?rev=907143&r1=907142&r2=907143&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java
 Sat Feb  6 00:46:55 2010
@@ -38,11 +38,11 @@
                                "</body>\n" +
                                "</html>";
                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-               final WritableByteChannel channel = new 
DocTypeSettingByteChannel(Channels.newChannel(baos),
+               final WritableByteChannel channel = new 
DocTypeFilteringByteChannel(Channels.newChannel(baos),
                                new ResponseStatusInfo() {
 
                        @Override
-                       public boolean isHtml() {
+                       public boolean convertXhtml2Html() {
                                return true;
                        }
 
@@ -64,11 +64,11 @@
                                "</body>\n" +
                                "</html>";
                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-               final WritableByteChannel channel = new 
DocTypeSettingByteChannel(Channels.newChannel(baos),
+               final WritableByteChannel channel = new 
DocTypeFilteringByteChannel(Channels.newChannel(baos),
                                new ResponseStatusInfo() {
 
                        @Override
-                       public boolean isHtml() {
+                       public boolean convertXhtml2Html() {
                                return true;
                        }
                });
@@ -95,11 +95,11 @@
                                "</body>\n" +
                                "</html>";
                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-               final WritableByteChannel channel = new 
DocTypeSettingByteChannel(Channels.newChannel(baos),
+               final WritableByteChannel channel = new 
DocTypeFilteringByteChannel(Channels.newChannel(baos),
                                new ResponseStatusInfo() {
 
                        @Override
-                       public boolean isHtml() {
+                       public boolean convertXhtml2Html() {
                                return true;
                        }
                });
@@ -124,11 +124,11 @@
                                "</body>\n" +
                                "</html>";
                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-               final WritableByteChannel channel = new 
DocTypeSettingByteChannel(Channels.newChannel(baos),
+               final WritableByteChannel channel = new 
DocTypeFilteringByteChannel(Channels.newChannel(baos),
                                new ResponseStatusInfo() {
 
                        @Override
-                       public boolean isHtml() {
+                       public boolean convertXhtml2Html() {
                                return true;
                        }
 
@@ -148,11 +148,11 @@
                                "</body>\n" +
                                "</html>";
                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-               final WritableByteChannel channel = new 
DocTypeSettingByteChannel(Channels.newChannel(baos),
+               final WritableByteChannel channel = new 
DocTypeFilteringByteChannel(Channels.newChannel(baos),
                                new ResponseStatusInfo() {
 
                        @Override
-                       public boolean isHtml() {
+                       public boolean convertXhtml2Html() {
                                return true;
                        }
 

Modified: 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannelTest.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannelTest.java?rev=907143&r1=907142&r2=907143&view=diff
==============================================================================
--- 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannelTest.java
 (original)
+++ 
incubator/clerezza/issues/CLEREZZA-69/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/SelfClosing2ClosingTagsByteChannelTest.java
 Sat Feb  6 00:46:55 2010
@@ -71,7 +71,7 @@
                                new ResponseStatusInfo() {
 
                        @Override
-                       public boolean isHtml() {
+                       public boolean convertXhtml2Html() {
                                return true;
                        }
 


Reply via email to