Coverage Report - org.mule.transformers.compression.GZipUncompressTransformer
 
Classes in this File Line Coverage Branch Coverage Complexity
GZipUncompressTransformer
0%
0/10
0%
0/1
3
 
 1  
 /*
 2  
  * $Id: GZipUncompressTransformer.java 7976 2007-08-21 14:26:13Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.transformers.compression;
 12  
 
 13  
 import org.mule.config.i18n.MessageFactory;
 14  
 import org.mule.umo.transformer.TransformerException;
 15  
 
 16  
 import java.io.IOException;
 17  
 
 18  
 import org.apache.commons.lang.SerializationUtils;
 19  
 
 20  
 /**
 21  
  * <code>GZipCompressTransformer</code> TODO
 22  
  */
 23  
 public class GZipUncompressTransformer extends GZipCompressTransformer
 24  
 {
 25  
 
 26  
     public GZipUncompressTransformer()
 27  
     {
 28  0
         super();
 29  0
     }
 30  
 
 31  
     // @Override
 32  
     public Object doTransform(Object src, String encoding) throws TransformerException
 33  
     {
 34  0
         byte[] buffer = null;
 35  
 
 36  
         try
 37  
         {
 38  0
             buffer = getStrategy().uncompressByteArray((byte[]) src);
 39  
         }
 40  0
         catch (IOException e)
 41  
         {
 42  0
             throw new TransformerException(MessageFactory.createStaticMessage("Failed to uncompress message."),
 43  
                 this, e);
 44  0
         }
 45  
 
 46  0
         if (!getReturnClass().equals(byte[].class))
 47  
         {
 48  0
             return SerializationUtils.deserialize(buffer);
 49  
         }
 50  
 
 51  0
         return buffer;
 52  
     }
 53  
 
 54  
 }