org.codehaus.mojo.dependency
Class DependencyUtil

java.lang.Object
  extended by org.codehaus.mojo.dependency.DependencyUtil

public class DependencyUtil
extends java.lang.Object

Utility class with static helper methods

Author:
brianf

Constructor Summary
DependencyUtil()
           
 
Method Summary
protected static void copyFile(java.io.File artifact, java.io.File destFile, org.apache.maven.plugin.logging.Log log)
          Does the actual copy of the file and logging.
static java.lang.String getFormattedFileName(org.apache.maven.artifact.Artifact artifact, boolean removeVersion)
          Builds the file name.
protected static void unpackFile(org.apache.maven.artifact.Artifact artifact, java.io.File unpackDirectory, java.io.File markersDirectory, org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager, org.apache.maven.plugin.logging.Log log)
          Unpacks the archive file, checking for a marker file to see if it should unpack again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyUtil

public DependencyUtil()
Method Detail

copyFile

protected static void copyFile(java.io.File artifact,
                               java.io.File destFile,
                               org.apache.maven.plugin.logging.Log log)
                        throws org.apache.maven.plugin.MojoExecutionException
Does the actual copy of the file and logging.

Parameters:
artifact - represents the file to copy.
destFile - file name of destination file.
log - to use for output.
Throws:
org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.

unpackFile

protected static void unpackFile(org.apache.maven.artifact.Artifact artifact,
                                 java.io.File unpackDirectory,
                                 java.io.File markersDirectory,
                                 org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager,
                                 org.apache.maven.plugin.logging.Log log)
                          throws org.apache.maven.plugin.MojoExecutionException
Unpacks the archive file, checking for a marker file to see if it should unpack again. Creates the marker file after unpacking.

Parameters:
Artifact - File to be unpacked.
unpackDirectory - Location where to put the unpacked files.
Throws:
org.apache.maven.plugin.MojoExecutionException

getFormattedFileName

public static java.lang.String getFormattedFileName(org.apache.maven.artifact.Artifact artifact,
                                                    boolean removeVersion)
Builds the file name. If removeVersion is set, then the file name must be reconstructed from the artifactId, Classifier (if used) and Type. Otherwise, this method returns the artifact file name.

Parameters:
artifact - File to be formatted.
removeVersion - Specifies if the version should be removed from the file name.
Returns:
Formatted file name in the format artifactId-[classifier-][version].[type]


Copyright © {inceptionYear}-2008 null. All Rights Reserved.