public class ExistsJob
extends java.lang.Object
implements java.lang.Runnable, java.io.Serializable
<oddjob id="this"> <job> <exists file="${this.args[0]}/test/io/reference/test1.txt"/> </job> </oddjob>
<oddjob id="this" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"> <job> <sequential name="The Classic File Polling Example"> <jobs> <scheduling:retry limits="${timer.current}"> <schedule> <schedules:interval interval="00:00:02"/> </schedule> <job> <sequential id="echo-when-file"> <jobs> <exists id="check" name="Check File Exists" file="${work.dir}/done.flag"/> <echo>Found ${check.exists[0]}</echo> </jobs> </sequential> </job> </scheduling:retry> </jobs> </sequential> </job> </oddjob>
<oddjob id="this"> <job> <sequential name="Find Files"> <jobs> <exists id="exists" file="${this.args[0]}/test/io/reference/test*.txt"/> <foreach id="found"> <values> <value value="${exists.exists}"/> </values> <configuration> <xml> <foreach id="found"> <job> <echo>found ${found.current}</echo> </job> </foreach> </xml> </configuration> </foreach> </jobs> </sequential> </job> </oddjob>
Constructor and Description |
---|
ExistsJob() |
Modifier and Type | Method and Description |
---|---|
java.io.File[] |
getExists() |
java.lang.String |
getFile()
Get the file.
|
java.util.Date |
getLastModified() |
java.lang.String |
getName()
Get the name.
|
int |
getResult()
Get the result.
|
long |
getSize() |
void |
run() |
void |
setFile(java.lang.String file)
Set the file.
|
void |
setName(java.lang.String name)
Set the name
|
java.lang.String |
toString() |
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name.public java.lang.String getFile()
public void setFile(java.lang.String file)
The
- file specification.public java.io.File[] getExists()
public int getResult()
public void run()
run
in interface java.lang.Runnable
public long getSize()
Property: size
Description: If a single file is found, this is the size of the file in bytes, or -1 if a single file hasn't been found.
Required: R/O.
public java.util.Date getLastModified()
Property: lastModified
Description: If a single file is found, this is the last modified date of the file.
Required: R/O.
public java.lang.String toString()
toString
in class java.lang.Object