|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.acmsl.antmake.AntMakeUtils
Provides some methods useful for managing AntMake-related logic.
Field Summary | |
static java.io.File[] |
EMPTY_FILE_ARRAY
Empty file array. |
static org.apache.tools.ant.types.FileSet[] |
EMPTY_FILESET_ARRAY
Empty fileset array. |
protected static java.lang.String[] |
EMPTY_STRING_ARRAY
An empty String array. |
Constructor Summary | |
protected |
AntMakeUtils()
Protected constructor to avoid accidental instantiation. |
Method Summary | |
protected org.acmsl.commons.regexpplugin.Helper |
createHelper()
Creates a helper instance. |
java.lang.String[] |
findIncludedFiles(org.apache.tools.ant.types.FileSet fileSet,
org.apache.tools.ant.Project project)
Retrieves the paths of the files included by given fileset. |
static AntMakeUtils |
getInstance()
Retrieves a AntMakeUtils instance. |
java.lang.String |
getLeafFolder(java.lang.String path)
Retrieves the leaf folder of to given path. |
protected static java.lang.ref.WeakReference |
getReference()
Retrieves the weak reference. |
java.lang.String[] |
getSubfolders(java.lang.String path)
Splits given path into its subfolders. |
void |
log(org.apache.tools.ant.Task task,
java.lang.String message,
int level)
Logs a concrete message using given task. |
java.io.File[] |
mergeFiles(org.apache.tools.ant.types.FileSet[] fileSets,
java.io.File folder,
org.apache.tools.ant.Task task)
Retrieves the files contained in given filesets, and copies them to given folder. |
java.lang.String |
replaceAll(java.lang.String input,
java.lang.String pattern,
java.lang.String replacement)
Replaces all ocurrences of a pattern with an alternative text inside given input. |
protected static void |
setReference(AntMakeUtils utils)
Specifies a new weak reference. |
java.lang.String[] |
split(java.lang.String input,
java.lang.String separator)
Divides given input into tokens delimited by given separator. |
org.apache.tools.ant.types.FileSet |
toFileSet(java.lang.String location,
org.apache.tools.ant.Project project,
java.lang.String[] inFilters,
java.lang.String[] outFilters)
Builds a FileSet for given location, taking all specified file types. |
org.apache.tools.ant.types.FileSet[] |
toFileSets(org.apache.tools.ant.types.Path path,
java.lang.String[] inFilters,
java.lang.String[] outFilters)
Translates given path to a collection of filesets. |
java.lang.String |
toPackage(java.lang.String folder)
Retrieves the package name associated to given relative folder. |
java.lang.String |
toRelativeFolder(java.lang.String packageName)
Retrieves the relative folder associated to given package name. |
java.lang.String |
toSpecificPackage(java.lang.String folder)
Retrieves the specific package associated to given relative folder. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final org.apache.tools.ant.types.FileSet[] EMPTY_FILESET_ARRAY
public static final java.io.File[] EMPTY_FILE_ARRAY
protected static final java.lang.String[] EMPTY_STRING_ARRAY
Constructor Detail |
protected AntMakeUtils()
Method Detail |
protected static void setReference(AntMakeUtils utils)
utils
- the utils instance to use.protected static java.lang.ref.WeakReference getReference()
public static AntMakeUtils getInstance()
public org.apache.tools.ant.types.FileSet[] toFileSets(org.apache.tools.ant.types.Path path, java.lang.String[] inFilters, java.lang.String[] outFilters)
path
- the path to translate.inFilters
- the included file filters, for retrieving files
through descendent folders recursively.outFilters
- the excluded file filters.
public org.apache.tools.ant.types.FileSet toFileSet(java.lang.String location, org.apache.tools.ant.Project project, java.lang.String[] inFilters, java.lang.String[] outFilters)
location
- the location.project
- the project.inFilters
- the included file filters, for retrieving files
through descendent folders recursively.outFilters
- the excluded file filters.
public java.lang.String[] findIncludedFiles(org.apache.tools.ant.types.FileSet fileSet, org.apache.tools.ant.Project project)
fileSet
- the fileset.project
- the project.
public java.io.File[] mergeFiles(org.apache.tools.ant.types.FileSet[] fileSets, java.io.File folder, org.apache.tools.ant.Task task) throws AntMakeException
fileSets
- such filesets.folder
- the destination folder.task
- the Ant task.
AntMakeException
- if there's some problem merging
the filespublic java.lang.String toPackage(java.lang.String folder)
folder
- the folder.
public java.lang.String getLeafFolder(java.lang.String path)
path
- the path.
public java.lang.String toSpecificPackage(java.lang.String folder)
folder
- the folder.
public java.lang.String toRelativeFolder(java.lang.String packageName)
packageName
- the package name.
public java.lang.String replaceAll(java.lang.String input, java.lang.String pattern, java.lang.String replacement)
input
- the original text.pattern
- to identify what to replace.replacement
- the replacement.
public java.lang.String[] getSubfolders(java.lang.String path)
path
- the path to split.
public java.lang.String[] split(java.lang.String input, java.lang.String separator)
input
- the input.
protected org.acmsl.commons.regexpplugin.Helper createHelper()
public void log(org.apache.tools.ant.Task task, java.lang.String message, int level)
task
- the task to use to log the message.message
- the message to log.level
- the log level the message is associated to.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |