org.oddjob.io
Class FilesType

java.lang.Object
  extended by org.oddjob.io.FilesType
All Implemented Interfaces:
Serializable, ArooaValue

public class FilesType
extends Object
implements ArooaValue, Serializable

Description

Specify files using a wildcard pattern. Also support building complicated collections of files using the list property.

Example

A single file.
<files files="onefile.txt"/>

Example

Using a wildcard expression.
<files files="reports/*.txt"/>

Example

Specifying a list of files.
<files>
    <list>
        <files files="onefile.txt"/>
        <files files="reports/*.txt"/>
    </list>
</files>

Example

A complex version of building up a file list. It includes taking advantage of Oddjob's built in path conversion and adds in files specified as arguments passed in to Oddjob.
<oddjob id="this">
    <job>
        <sequential>
            <jobs>
                <variables id="vars">
                    <aList>
                        <files>
                            <list>
                                <file file="a.jar"/>
                                <value value="b.jar${path.separator}c.jar"/>
                                <value value="${this.args}"/>
                            </list>
                        </files>
                    </aList>
                </variables>
                <foreach>
                    <values>
                        <value value="${vars.aList}"/>
                    </values>
                    <configuration>
                        <xml>
                            <foreach id="loop">
                                <job>
                                    <echo>${loop.current}</echo>
                                </job>
                            </foreach>
                        </xml>
                    </configuration>
                </foreach>
            </jobs>
        </sequential>
    </job>
</oddjob>
See Also:
Serialized Form
Author:
Rob Gordon.

Nested Class Summary
static class FilesType.Conversions
           
 
Constructor Summary
FilesType()
           
 
Method Summary
 String getFiles()
           
 void setFiles(String files)
          Set the directory for a scan.
 void setList(int index, File[] files)
           
 File[] toFiles()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilesType

public FilesType()
Method Detail

setFiles

public void setFiles(String files)
Set the directory for a scan.

Parameters:
directory - The directory.

getFiles

public String getFiles()

setList

public void setList(int index,
                    File[] files)

toFiles

public File[] toFiles()

toString

public String toString()
Overrides:
toString in class Object