anonFs.setDir(new File(dir));
File oFile = new File(file); if(oFile.isDirectory()){ anonFs.setDir(oFile); } else { anonFs.setFile(oFile); }
    private void copySourcesToDest() throws BuildException {        Copy copy = new Copy();        copy.setProject(getProject());        copy.setTodir(m_destdir);        copy.setOverwrite(false);        copy.setTaskName("copy");        copy.setVerbose(m_verbose);        List sourceDir = getDirectories(m_src);        for (Iterator iterator = sourceDir.iterator(); iterator.hasNext();) {            String dir = (String) iterator.next();            FileSet anonFs = new FileSet();            anonFs.setIncludes(CLASS_PATTERN);            if (m_includePattern != null) {                anonFs.setIncludes(m_includePattern);            }            anonFs.setDir(new File(dir));            copy.addFileset(anonFs);        }        copy.execute();    }