org.apache.tools.ant.types

Class FileList

public class FileList extends DataType

FileList represents an explicitly named list of files. FileLists are useful when you want to capture a list of files regardless of whether they currently exist. By contrast, FileSet operates as a filter, only returning the name of a matched file if it currently exists in the file system.
Nested Class Summary
static classFileList.FileName
Inner class corresponding to the <file> nested element.
Constructor Summary
FileList()
The default constructor.
protected FileList(FileList filelist)
A copy constructor.
Method Summary
voidaddConfiguredFile(FileList.FileName name)
Add a nested <file> nested element.
FilegetDir(Project p)
String[]getFiles(Project p)
Returns the list of files represented by this FileList.
protected FileListgetRef(Project p)
Performs the check for circular references and returns the referenced FileList.
voidsetDir(File dir)
Set the dir attribute.
voidsetFiles(String filenames)
Set the filenames attribute.
voidsetRefid(Reference r)
Makes this instance in effect a reference to another FileList instance.

Constructor Detail

FileList

public FileList()
The default constructor.

FileList

protected FileList(FileList filelist)
A copy constructor.

Parameters: filelist a FileList value

Method Detail

addConfiguredFile

public void addConfiguredFile(FileList.FileName name)
Add a nested <file> nested element.

Parameters: name a configured file element with a name.

getDir

public File getDir(Project p)

Parameters: p the current project

Returns: the directory attribute

getFiles

public String[] getFiles(Project p)
Returns the list of files represented by this FileList.

Parameters: p the current project

Returns: the list of files represented by this FileList.

getRef

protected FileList getRef(Project p)
Performs the check for circular references and returns the referenced FileList.

Parameters: p the current project

Returns: the FileList represented by a referenced filelist.

setDir

public void setDir(File dir)
Set the dir attribute.

Parameters: dir the directory this filelist is relative to.

Throws: BuildException if an error occurs

setFiles

public void setFiles(String filenames)
Set the filenames attribute.

Parameters: filenames a string contains filenames, separated by , or by whitespace.

setRefid

public void setRefid(Reference r)
Makes this instance in effect a reference to another FileList instance.

You must not set another attribute or nest elements inside this element if you make it a reference.

Parameters: r the reference to another filelist.

Throws: BuildException if an error occurs.

Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.