org.jcoderz.commons.taskdefs
Class AntTaskUtil

java.lang.Object
  extended by org.jcoderz.commons.taskdefs.AntTaskUtil

public final class AntTaskUtil
extends Object

Provides utility functions for Ant task.

Author:
Michael Griffel

Method Summary
static void ensureDirectory(File directory)
          Ensure the directory exists for a given directory name.
static void ensureDirectoryForFile(File targetFile)
          Ensure the directory exists for a given file.
static void renderDotFiles(org.apache.tools.ant.Task task, File dotDir, boolean failOnError)
          Render dot files.
static void renderGnuplotFiles(org.apache.tools.ant.Task task, File gnuplotDir, boolean failOnError)
          Render .gnuplot files.
static String stripFileExtension(String fileWithExtension)
          Strip file extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ensureDirectory

public static void ensureDirectory(File directory)
                            throws org.apache.tools.ant.BuildException
Ensure the directory exists for a given directory name.

Parameters:
directory - the directory name that is required.
Throws:
org.apache.tools.ant.BuildException - if the directories cannot be created.

ensureDirectoryForFile

public static void ensureDirectoryForFile(File targetFile)
                                   throws org.apache.tools.ant.BuildException
Ensure the directory exists for a given file.

Parameters:
targetFile - the file for which the directories are required.
Throws:
org.apache.tools.ant.BuildException - if the directories cannot be created.

stripFileExtension

public static String stripFileExtension(String fileWithExtension)
Strip file extension.

Parameters:
fileWithExtension - the file with extension
Returns:
the string

renderDotFiles

public static void renderDotFiles(org.apache.tools.ant.Task task,
                                  File dotDir,
                                  boolean failOnError)
Render dot files.

Parameters:
task - the task
dotDir - the dot dir
failOnError - the fail on error

renderGnuplotFiles

public static void renderGnuplotFiles(org.apache.tools.ant.Task task,
                                      File gnuplotDir,
                                      boolean failOnError)
Render .gnuplot files.

Parameters:
task - the task
gnuplotDir - the gnuplot dir
failOnError - the fail on error


Copyright 2007 The jCoderZ Project.