Coverage Report - org.apache.tapestry5.util.ResponseWrapper
 
Classes in this File Line Coverage Branch Coverage Complexity
ResponseWrapper
0%
0/25
N/A
1
 
 1  
 // Copyright 2009 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.tapestry5.util;
 16  
 
 17  
 import org.apache.tapestry5.Link;
 18  
 import org.apache.tapestry5.ioc.internal.util.Defense;
 19  
 import org.apache.tapestry5.services.Response;
 20  
 
 21  
 import java.io.IOException;
 22  
 import java.io.OutputStream;
 23  
 import java.io.PrintWriter;
 24  
 
 25  
 /**
 26  
  * Implementation of {@link org.apache.tapestry5.services.Response} that delegates all method invocations to a delegate
 27  
  * instance. This is used as a base class for overriding just some behaviors of Response.
 28  
  */
 29  
 public class ResponseWrapper implements Response
 30  
 {
 31  
     protected final Response response;
 32  
 
 33  
     public ResponseWrapper(Response response)
 34  0
     {
 35  0
         Defense.notNull(response, "response");
 36  
 
 37  0
         this.response = response;
 38  0
     }
 39  
 
 40  
     public PrintWriter getPrintWriter(String contentType) throws IOException
 41  
     {
 42  0
         return response.getPrintWriter(contentType);
 43  
     }
 44  
 
 45  
     public OutputStream getOutputStream(String contentType) throws IOException
 46  
     {
 47  0
         return response.getOutputStream(contentType);
 48  
     }
 49  
 
 50  
     public void sendRedirect(String URL) throws IOException
 51  
     {
 52  0
         response.sendRedirect(URL);
 53  0
     }
 54  
 
 55  
     public void sendRedirect(Link link) throws IOException
 56  
     {
 57  0
         response.sendRedirect(link);
 58  0
     }
 59  
 
 60  
     public void setStatus(int sc)
 61  
     {
 62  0
         response.setStatus(sc);
 63  0
     }
 64  
 
 65  
     public void sendError(int sc, String message) throws IOException
 66  
     {
 67  0
         response.sendError(sc, message);
 68  0
     }
 69  
 
 70  
     public void setContentLength(int length)
 71  
     {
 72  0
         response.setContentLength(length);
 73  0
     }
 74  
 
 75  
     public void setDateHeader(String name, long date)
 76  
     {
 77  0
         response.setDateHeader(name, date);
 78  0
     }
 79  
 
 80  
     public void setHeader(String name, String value)
 81  
     {
 82  0
         response.setHeader(name, value);
 83  0
     }
 84  
 
 85  
     public void setIntHeader(String name, int value)
 86  
     {
 87  0
         response.setIntHeader(name, value);
 88  0
     }
 89  
 
 90  
     public String encodeURL(String URL)
 91  
     {
 92  0
         return response.encodeURL(URL);
 93  
     }
 94  
 
 95  
     public String encodeRedirectURL(String URL)
 96  
     {
 97  0
         return response.encodeRedirectURL(URL);
 98  
     }
 99  
 
 100  
     public boolean isCommitted()
 101  
     {
 102  0
         return response.isCommitted();
 103  
     }
 104  
 }