Coverage Report - org.apache.maven.artifact.handler.DefaultArtifactHandler
 
Classes in this File Line Coverage Branch Coverage Complexity
DefaultArtifactHandler
29 %
6/21
0 %
0/8
1,4
 
 1  
 package org.apache.maven.artifact.handler;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *  http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 /**
 23  
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
 24  
  * @version $Id: DefaultArtifactHandler.java 640549 2008-03-24 20:05:11Z bentmann $
 25  
  */
 26  
 public class DefaultArtifactHandler
 27  
     implements ArtifactHandler
 28  
 {
 29  
     private String extension;
 30  
 
 31  
     private String type;
 32  
 
 33  
     private String classifier;
 34  
 
 35  
     private String directory;
 36  
 
 37  
     private String packaging;
 38  
 
 39  
     private boolean includesDependencies;
 40  
 
 41  
     private String language;
 42  
 
 43  
     private boolean addedToClasspath;
 44  
 
 45  
     public DefaultArtifactHandler()
 46  442
     {
 47  442
     }
 48  
 
 49  
     public DefaultArtifactHandler( String type )
 50  5
     {
 51  5
         this.type = type;
 52  5
     }
 53  
 
 54  
     public String getExtension()
 55  
     {
 56  0
         if ( extension == null )
 57  
         {
 58  0
             extension = type;
 59  
         }
 60  0
         return extension;
 61  
     }
 62  
 
 63  
     public String getType()
 64  
     {
 65  0
         return type;
 66  
     }
 67  
 
 68  
     public String getClassifier()
 69  
     {
 70  771
         return classifier;
 71  
     }
 72  
 
 73  
     public String getDirectory()
 74  
     {
 75  0
         if ( directory == null )
 76  
         {
 77  0
             directory = getPackaging() + "s";
 78  
         }
 79  0
         return directory;
 80  
     }
 81  
 
 82  
     public String getPackaging()
 83  
     {
 84  0
         if ( packaging == null )
 85  
         {
 86  0
             packaging = type;
 87  
         }
 88  0
         return packaging;
 89  
     }
 90  
 
 91  
     public boolean isIncludesDependencies()
 92  
     {
 93  0
         return includesDependencies;
 94  
     }
 95  
 
 96  
     public String getLanguage()
 97  
     {
 98  0
         if ( language == null )
 99  
         {
 100  0
             language = "none";
 101  
         }
 102  
 
 103  0
         return language;
 104  
     }
 105  
 
 106  
     public boolean isAddedToClasspath()
 107  
     {
 108  0
         return addedToClasspath;
 109  
     }
 110  
 }