Coverage Report - org.codehaus.plexus.archiver.util.FilterSupport
 
Classes in this File Line Coverage Branch Coverage Complexity
FilterSupport
0 %
0/16
0 %
0/10
3,5
 
 1  
 package org.codehaus.plexus.archiver.util;
 2  
 
 3  
 import java.io.InputStream;
 4  
 import java.util.List;
 5  
 import org.codehaus.plexus.archiver.ArchiveFileFilter;
 6  
 import org.codehaus.plexus.archiver.Archiver;
 7  
 import org.codehaus.plexus.components.io.fileselectors.FileSelector;
 8  
 import org.codehaus.plexus.logging.Logger;
 9  
 
 10  
 /**
 11  
  * @deprecated Use {@link FileSelector} and {@link Archiver#addFileSet}.
 12  
  */
 13  
 @Deprecated
 14  
 public class FilterSupport
 15  
 {
 16  
 
 17  
     private final List<ArchiveFileFilter> filters;
 18  
 
 19  
     private final Logger logger;
 20  
 
 21  0
     public FilterSupport( List<ArchiveFileFilter> filters, Logger logger )
 22  0
     {
 23  0
         this.filters = filters;
 24  0
         this.logger = logger;
 25  0
     }
 26  
 
 27  
     public boolean include( InputStream dataStream, String entryName )
 28  
     {
 29  0
         boolean included = true;
 30  
 
 31  0
         if ( filters != null && !filters.isEmpty() )
 32  
         {
 33  0
             for ( ArchiveFileFilter filter : filters )
 34  
             {
 35  0
                 included = filter.include( dataStream, entryName );
 36  
 
 37  0
                 if ( !included )
 38  
                 {
 39  0
                     if ( logger.isDebugEnabled() )
 40  
                     {
 41  0
                         logger.debug( "Entry: \'" + entryName + "\' excluded by filter: "
 42  0
                                           + filter.getClass().getName() );
 43  
 
 44  
                     }
 45  
 
 46  0
                     break;
 47  
                 }
 48  0
             }
 49  
         }
 50  
 
 51  0
         return included;
 52  
     }
 53  
 
 54  
 }