FileDocCategorySizeDatePackage
FileTask.javaAPI DocAndroid 1.5 API3904Wed May 06 22:41:16 BST 2009com.vladium.emma.ant

FileTask

public abstract class FileTask extends NestedTask
author
Vlad Roubtsov, (C) 2003

Fields Summary
private final List
m_dataFileSets
private static final String[]
EMPTY_STRING_ARRAY
Constructors Summary
protected FileTask(SuppressableTask parent)

        super (parent);
        
        m_dataFileSets = new ArrayList ();
//        m_dataFiles = new ArrayList ();
    
Methods Summary
public final voidaddFileset(com.vladium.emma.ant.XFileSet set)

        if (set != null) m_dataFileSets.add (set);
    
public final voidaddInfileset(com.vladium.emma.ant.XFileSet set)

        if (set != null) m_dataFileSets.add (set);
    
protected final java.lang.String[]getDataPath(boolean removeNonexistent)

        final List /* String */ _files = new ArrayList ();
            
        // merge filesets:
        for (Iterator i = m_dataFileSets.iterator (); i.hasNext (); )
        {
            final FileSet set = (FileSet) i.next ();
            final DirectoryScanner ds = set.getDirectoryScanner (project);
            final File dsBaseDir = ds.getBasedir ();
            
            final String [] dsfiles = ds.getIncludedFiles ();
            for (int f = 0; f < dsfiles.length; ++ f)
            {
                _files.add (new File (dsBaseDir, dsfiles [f]).getAbsolutePath ());
            }
        }
        
//        // merge files:
//        for (Iterator i = m_dataFiles.iterator (); i.hasNext (); )
//        {
//            final File file = (File) i.next ();
//            if (! removeNonexistent || file.exists ())
//            {
//                _files.add (file.getAbsolutePath ());
//            }
//        }
        
        if (_files.size () == 0)
            return EMPTY_STRING_ARRAY;
        else
        {            
            final String [] files = new String [_files.size ()];
            _files.toArray (files);
            
            return files;
        }