Save This Page
Home » apache-ant-1.8.1 » org.apache.tools » ant » taskdefs » [javadoc | source]
org.apache.tools.ant.taskdefs
public class: Touch [javadoc | source]
java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.Task
         org.apache.tools.ant.taskdefs.Touch

All Implemented Interfaces:
    Cloneable

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.

Nested Class Summary:
public interface  Touch.DateFormatFactory   
Field Summary
public static final  DateFormatFactory DEFAULT_DF_FACTORY     
Fields inherited from org.apache.tools.ant.Task:
target,  taskName,  taskType,  wrapper
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Constructor:
 public Touch() 
Method from org.apache.tools.ant.taskdefs.Touch Summary:
add,   add,   addConfiguredMapper,   addFilelist,   addFileset,   checkConfiguration,   execute,   setDatetime,   setFile,   setMillis,   setMkdirs,   setPattern,   setVerbose,   touch,   touch
Methods from org.apache.tools.ant.Task:
bindToOwner,   execute,   getOwningTarget,   getRuntimeConfigurableWrapper,   getTaskName,   getTaskType,   getWrapper,   handleErrorFlush,   handleErrorOutput,   handleFlush,   handleInput,   handleOutput,   init,   isInvalid,   log,   log,   log,   log,   markInvalid,   maybeConfigure,   perform,   reconfigure,   setOwningTarget,   setRuntimeConfigurableWrapper,   setTaskName,   setTaskType
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.taskdefs.Touch Detail:
 public  void add(FileNameMapper fileNameMapper) throws BuildException 
    Add a FileNameMapper.
 public synchronized  void add(ResourceCollection rc) 
    Add a collection of resources to touch.
 public  void addConfiguredMapper(Mapper mapper) 
    Add a Mapper.
 public  void addFilelist(FileList list) 
    Add a filelist to touch.
 public  void addFileset(FileSet set) 
    Add a set of files to touch.
 protected synchronized  void checkConfiguration() throws BuildException 
    Check that this task has been configured properly.
 public  void execute() throws BuildException 
    Execute the touch operation.
 public  void setDatetime(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". Optional, default=now.
 public  void setFile(File file) 
    Sets a single source file to touch. If the file does not exist an empty file will be created.
 public  void setMillis(long millis) 
    Set the new modification time of file(s) touched in milliseconds since midnight Jan 1 1970. Optional, default=now.
 public  void setMkdirs(boolean mkdirs) 
    Set whether nonexistent parent directories should be created when touching new files.
 public  void setPattern(String pattern) 
    Set the format of the datetime attribute.
 public  void setVerbose(boolean verbose) 
    Set whether the touch task will report every file it creates; defaults to true.
 protected  void touch() throws BuildException 
    Does the actual work; assumes everything has been checked by now.
 protected  void touch(File file) 
Deprecated! since - 1.6.x.

    Touch a single file with the current timestamp (this.millis). This method does not interact with any nested mappers and remains for reasons of backwards-compatibility only.