org.codehaus.mojo.dependency

Class DependencyUtil

public class DependencyUtil extends Object

Utility class with static helper methods

Author: brianf

Method Summary
protected static voidcopyFile(File artifact, File destFile, Log log)
Does the actual copy of the file and logging.
static StringgetFormattedFileName(Artifact artifact, boolean removeVersion)
Builds the file name.
protected static voidunpackFile(Artifact artifact, File unpackDirectory, File markersDirectory, ArchiverManager archiverManager, Log log)
Unpacks the archive file, checking for a marker file to see if it should unpack again.

Method Detail

copyFile

protected static void copyFile(File artifact, File destFile, Log log)
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: MojoExecutionException with a message if an error occurs.

getFormattedFileName

public static String getFormattedFileName(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]

unpackFile

protected static void unpackFile(Artifact artifact, File unpackDirectory, File markersDirectory, ArchiverManager archiverManager, Log log)
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.

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