/** * Creates a single file fileset. * @param file the single <code>File</code> included in this * <code>AbstractFileSet</code>. */ public synchronized void setFile(File file) { if (isReference()) { throw tooManyAttributes(); } if (fileAttributeUsed) { if (getDir().equals(file.getParentFile())) { String[] includes = defaultPatterns.getIncludePatterns(getProject()); if (includes.length == 1 && includes[0].equals(file.getName())) { // NOOP, setFile has been invoked twice with the same parameter return; } } throw new BuildException("setFile cannot be called twice with different arguments"); } else if (getDir() != null) { throw dirAndFileAreMutuallyExclusive(); } setDir(file.getParentFile()); fileAttributeUsed = true; createInclude().setName(file.getName()); }
fileSet.setDir( fileList.getDir( getProject() ) );