Coverage Report - org.apache.tapestry.portlet.PortletWebResponse
 
Classes in this File Line Coverage Branch Coverage Complexity
PortletWebResponse
0%
0/25
N/A
1.077
 
 1  
 // Copyright 2005 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // Unless required by applicable law or agreed to in writing, software
 10  
 // distributed under the License is distributed on an "AS IS" BASIS,
 11  
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
 // See the License for the specific language governing permissions and
 13  
 // limitations under the License.
 14  
 
 15  
 package org.apache.tapestry.portlet;
 16  
 
 17  
 import java.io.IOException;
 18  
 import java.io.OutputStream;
 19  
 import java.io.PrintWriter;
 20  
 
 21  
 import javax.portlet.PortletResponse;
 22  
 
 23  
 import org.apache.hivemind.util.Defense;
 24  
 import org.apache.tapestry.util.ContentType;
 25  
 import org.apache.tapestry.web.WebResponse;
 26  
 
 27  
 /**
 28  
  * Adapts {@link javax.portlet.PortletResponse} as
 29  
  * {@link org.apache.tapestry.web.WebResponse}.
 30  
  * 
 31  
  * @author Howard M. Lewis Ship
 32  
  * @since 4.0
 33  
  */
 34  
 public class PortletWebResponse implements WebResponse
 35  
 {
 36  
 
 37  
     private final PortletResponse _portletResponse;
 38  
 
 39  
     public PortletWebResponse(PortletResponse portletResponse)
 40  0
     {
 41  0
         Defense.notNull(portletResponse, "portletResponse");
 42  
 
 43  0
         _portletResponse = portletResponse;
 44  0
     }
 45  
 
 46  
     public OutputStream getOutputStream(ContentType contentType)
 47  
         throws IOException
 48  
     {
 49  0
         unsupported("getOutputStream");
 50  
 
 51  0
         return null;
 52  
     }
 53  
 
 54  
     public PrintWriter getPrintWriter(ContentType contentType)
 55  
         throws IOException
 56  
     {
 57  0
         unsupported("getPrintWriter");
 58  
 
 59  0
         return null;
 60  
     }
 61  
 
 62  
     public String encodeURL(String url)
 63  
     {
 64  0
         return _portletResponse.encodeURL(url);
 65  
     }
 66  
 
 67  
     /** Unsupported. */
 68  
     public void reset()
 69  
     {
 70  0
         unsupported("reset");
 71  0
     }
 72  
 
 73  
     /** Unsupported. */
 74  
     public void setContentLength(int contentLength)
 75  
     {
 76  0
         unsupported("setContentLength");
 77  0
     }
 78  
 
 79  
     /**
 80  
      * Returns the empty string. The {@link RenderWebResponse} subclass
 81  
      * actually provides a real value here.
 82  
      */
 83  
     public String getNamespace()
 84  
     {
 85  0
         return "";
 86  
     }
 87  
 
 88  
     protected final void unsupported(String methodName)
 89  
     {
 90  0
         throw new UnsupportedOperationException(PortletMessages
 91  
                 .unsupportedMethod(methodName));
 92  
     }
 93  
 
 94  
     /** Unsupported. */
 95  
     public void setDateHeader(String string, long date)
 96  
     {
 97  0
         unsupported("setDateHeader");
 98  0
     }
 99  
 
 100  
     /** Unsupported. */
 101  
     public void setStatus(int status)
 102  
     {
 103  0
         unsupported("setStatus");
 104  0
     }
 105  
 
 106  
     /** Unsupported. */
 107  
     public void setHeader(String name, String value)
 108  
     {
 109  0
         unsupported("setHeader");
 110  0
     }
 111  
 
 112  
     /** Unsupported. */
 113  
     public void setIntHeader(String name, int value)
 114  
     {
 115  0
         unsupported("setIntHeader");
 116  0
     }
 117  
 
 118  
     /** Unsupported. */
 119  
     public void sendError(int statusCode, String message)
 120  
         throws IOException
 121  
     {
 122  0
         unsupported("sendError");
 123  0
     }
 124  
 
 125  
 }