public class CUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CUtil.StringArrayBuilder
A class that splits a white-space, comma-separated list into a String
array.
|
Modifier and Type | Field and Description |
---|---|
static int |
FILETIME_EPSILON |
Constructor and Description |
---|
CUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addAll(Vector dest,
Object[] src)
Adds the elements of the array to the given vector
|
static int |
checkDirectoryArray(String[] names)
Checks a array of names for non existent or non directory entries and
nulls them out.
|
static String |
getBasename(File file)
Extracts the basename of a file, removing the extension, if present
|
static File |
getExecutableLocation(String exeName)
Gets the parent directory for the executable file name using the current
directory and system executable path
|
static String |
getParentPath(String path)
Extracts the parent of a file
|
static File[] |
getPathFromEnvironment(String envVariable,
String delim)
Returns an array of File for each existing directory in the specified
environment variable
|
static String |
getRelativePath(String base,
File targetFile)
Returns a relative path for the targetFile relative to the base
directory.
|
static boolean |
isActive(org.apache.tools.ant.Project p,
String ifCond,
String unlessCond) |
static boolean |
isSignificantlyAfter(long time1,
long time2)
Determines whether time1 is later than time2
to a degree that file system time truncation is not significant.
|
static boolean |
isSignificantlyBefore(long time1,
long time2)
Determines whether time1 is earlier than time2
to a degree that file system time truncation is not significant.
|
static boolean |
isSystemPath(File source)
Determines if source file has a system path,
that is part of the compiler or platform.
|
static File[] |
parsePath(String path,
String delim)
Parse a string containing directories into an File[]
|
static int |
runCommand(CCTask task,
File workingDir,
String[] cmdline,
boolean newEnvironment,
org.apache.tools.ant.types.Environment env)
This method is exposed so test classes can overload and test the
arguments without actually spawning the compiler
|
static boolean |
sameList(Object[] a,
Object[] b)
Compares the contents of 2 arrays for equaliy.
|
static boolean |
sameList(Vector v,
Object[] a)
Compares the contents of an array and a Vector for equality.
|
static boolean |
sameSet(Object[] a,
Vector b)
Compares the contents of an array and a Vector for set equality.
|
static String[] |
toArray(Vector src)
Converts a vector to a string array.
|
static String |
toUnixPath(String path) |
static String |
toWindowsPath(String path) |
static String |
xmlAttribEncode(String attrValue)
Replaces any embedded quotes in the string so that the value can be
placed in an attribute in an XML file
|
public static final int FILETIME_EPSILON
public static void addAll(Vector dest, Object[] src)
public static int checkDirectoryArray(String[] names)
public static String getBasename(File file)
public static File getExecutableLocation(String exeName)
exeName
- Name of executable such as "cl.exe"public static File[] getPathFromEnvironment(String envVariable, String delim)
envVariable
- environment variable name such as "LIB" or "INCLUDE"delim
- delimitor used to separate parts of the path, typically ";"
or ":"public static String getRelativePath(String base, File targetFile)
base
- base directory as returned by File.getCanonicalPath()targetFile
- target filepublic static boolean isActive(org.apache.tools.ant.Project p, String ifCond, String unlessCond) throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public static boolean isSignificantlyAfter(long time1, long time2)
time1
- long first time valuetime2
- long second time valuepublic static boolean isSignificantlyBefore(long time1, long time2)
time1
- long first time valuetime2
- long second time valuepublic static boolean isSystemPath(File source)
source
- source, may not be null.public static File[] parsePath(String path, String delim)
path
- path string, for example ".;c:\something\include"delim
- delimiter, typically ; or :public static int runCommand(CCTask task, File workingDir, String[] cmdline, boolean newEnvironment, org.apache.tools.ant.types.Environment env) throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public static boolean sameList(Object[] a, Object[] b)
public static boolean sameList(Vector v, Object[] a)
public static boolean sameSet(Object[] a, Vector b)
Copyright © 2005-2016 NAR Maven Plugin developers. All Rights Reserved.