Coverage Report - org.mule.transport.http.ReleasingInputStream
 
Classes in this File Line Coverage Branch Coverage Complexity
ReleasingInputStream
0%
0/7
0%
0/2
1.5
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.transport.http;
 8  
 
 9  
 import org.mule.model.streaming.DelegatingInputStream;
 10  
 
 11  
 import java.io.IOException;
 12  
 import java.io.InputStream;
 13  
 
 14  
 import org.apache.commons.httpclient.HttpMethod;
 15  
 
 16  
 public class ReleasingInputStream extends DelegatingInputStream
 17  
 {
 18  
     private final HttpMethod method;
 19  
 
 20  
     public ReleasingInputStream(InputStream is, HttpMethod method)
 21  
     {
 22  0
         super(is);
 23  
         
 24  0
         this.method = method;
 25  0
     }
 26  
 
 27  
     public void close() throws IOException 
 28  
     {
 29  0
         super.close();
 30  
         
 31  0
         if (method != null)
 32  
         {
 33  0
             method.releaseConnection();
 34  
         }
 35  0
     }
 36  
 }
 37