|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Touch
public class Touch
Touch a file and/or fileset(s) and/or filelist(s); corresponds to the Unix touch command.
If the file to touch doesn't exist, an empty one is created.
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
Touch()
Construct a new Touch task. |
|
| Method Summary | |
|---|---|
void |
add(FileNameMapper fileNameMapper)
Add a FileNameMapper. |
void |
add(ResourceCollection rc)
Add a collection of resources to touch. |
void |
addConfiguredMapper(Mapper mapper)
Add a Mapper. |
void |
addFilelist(FileList list)
Add a filelist to touch. |
void |
addFileset(FileSet set)
Add a set of files to touch. |
protected void |
checkConfiguration()
Check that this task has been configured properly. |
void |
execute()
Execute the touch operation. |
void |
setDatetime(java.lang.String dateTime)
Set the new modification time of file(s) touched in the format "MM/DD/YYYY HH:MM AM or PM" or "MM/DD/YYYY HH:MM:SS AM or PM". |
void |
setFile(java.io.File file)
Sets a single source file to touch. |
void |
setMillis(long millis)
Set the new modification time of file(s) touched in milliseconds since midnight Jan 1 1970. |
void |
setMkdirs(boolean mkdirs)
Set whether nonexistent parent directories should be created when touching new files. |
void |
setPattern(java.lang.String pattern)
Set the format of the datetime attribute. |
void |
setVerbose(boolean verbose)
Set whether the touch task will report every file it creates; defaults to true. |
protected void |
touch()
Does the actual work; assumes everything has been checked by now. |
protected void |
touch(java.io.File file)
Deprecated. since 1.6.x. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Touch()
Touch task.
| Method Detail |
|---|
public void setFile(java.io.File file)
file - the File to touch.public void setMillis(long millis)
millis - the long timestamp to use.public void setDatetime(java.lang.String dateTime)
dateTime - the String date in the specified format.public void setMkdirs(boolean mkdirs)
mkdirs - boolean whether to create parent directories.public void setVerbose(boolean verbose)
true.
verbose - boolean flag.public void setPattern(java.lang.String pattern)
pattern - the SimpleDateFormat-compatible format pattern.public void addConfiguredMapper(Mapper mapper)
Mapper.
mapper - the Mapper to add.
public void add(FileNameMapper fileNameMapper)
throws BuildException
FileNameMapper.
fileNameMapper - the FileNameMapper to add.
BuildException - if multiple mappers are added.public void addFileset(FileSet set)
set - the Fileset to add.public void addFilelist(FileList list)
list - the Filelist to add.public void add(ResourceCollection rc)
rc - the collection to add.
protected void checkConfiguration()
throws BuildException
BuildException - if configuration errors are detected.
public void execute()
throws BuildException
execute in class TaskBuildException - if an error occurs.
protected void touch()
throws BuildException
BuildException - if an error occurs.protected void touch(java.io.File file)
file - file to touch
BuildException - on error
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||