/** * Retrieves the base-directory for this instance. * @return <code>File</code>. */ public File getDir() { return getDir(getProject()); }
File base = fs.getDir(getProject());
FileSet fs = (FileSet) filesets.elementAt(j); DirectoryScanner ds = fs.getDirectoryScanner(getProject()); File fromDir = fs.getDir(getProject());
/** * Sets the base-directory for this instance. * @param dir the directory's <code>File</code> instance. * @throws BuildException on error */ public synchronized void setDir(File dir) throws BuildException { if (isReference()) { throw tooManyAttributes(); } if (fileAttributeUsed && !getDir().equals(dir)) { throw dirAndFileAreMutuallyExclusive(); } this.dir = dir; directoryScanner = null; }
/** * 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()); }
/** * Retrieves the base-directory for this instance. * @param p the <code>Project</code> against which the * reference is resolved, if set. * @return <code>File</code>. */ public synchronized File getDir(Project p) { if (isReference()) { return getRef(p).getDir(p); } dieOnCircularReference(); return dir; }