org.codehaus.mojo.license
Class MojoHelper

java.lang.Object
  extended by org.codehaus.mojo.license.MojoHelper

public class MojoHelper
extends Object

Mojo helper methods.

Since:
1.0
Author:
tchemit

Field Summary
protected static double[] timeFactors
           
protected static String[] timeUnites
           
 
Constructor Summary
MojoHelper()
           
 
Method Summary
static boolean addResourceDir(File dir, org.apache.maven.project.MavenProject project, List<?> resources, String... includes)
          Add the directory as a resource in the given resource list.
static boolean addResourceDir(File dir, org.apache.maven.project.MavenProject project, String... includes)
          Add the directory as a resource of the given project.
static String convert(long value, double[] factors, String[] unites)
           
static String convertTime(long value)
           
static String getArtifactId(org.apache.maven.artifact.Artifact artifact)
           
static String getArtifactName(org.apache.maven.project.MavenProject project)
           
static URL getUrl(URL baseUrl, String suffix)
          suffix a given baseUrl with the given suffix
static Comparator<org.apache.maven.project.MavenProject> newMavenProjectComparator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeFactors

protected static final double[] timeFactors

timeUnites

protected static final String[] timeUnites
Constructor Detail

MojoHelper

public MojoHelper()
Method Detail

addResourceDir

public static boolean addResourceDir(File dir,
                                     org.apache.maven.project.MavenProject project,
                                     String... includes)
Add the directory as a resource of the given project.

Parameters:
dir - the directory to add
project - the project to update
includes - the includes of the resource
Returns:
true if the resources was added (not already existing)

addResourceDir

public static boolean addResourceDir(File dir,
                                     org.apache.maven.project.MavenProject project,
                                     List<?> resources,
                                     String... includes)
Add the directory as a resource in the given resource list.

Parameters:
dir - the directory to add
project - the project involved
resources - the list of existing resources
includes - includes of the new resources
Returns:
true if the resource was added (not already existing)

newMavenProjectComparator

public static Comparator<org.apache.maven.project.MavenProject> newMavenProjectComparator()

convertTime

public static String convertTime(long value)

convert

public static String convert(long value,
                             double[] factors,
                             String[] unites)

getUrl

public static URL getUrl(URL baseUrl,
                         String suffix)
                  throws IllegalArgumentException
suffix a given baseUrl with the given suffix

Parameters:
baseUrl - base url to use
suffix - suffix to add
Returns:
the new url
Throws:
IllegalArgumentException - if malformed url.

getArtifactId

public static String getArtifactId(org.apache.maven.artifact.Artifact artifact)

getArtifactName

public static String getArtifactName(org.apache.maven.project.MavenProject project)


Copyright © 2010-2013 The Kuali Foundation. All Rights Reserved.