/** * Sets whether or not symbolic links should be followed. * * @param followSymlinks whether or not symbolic links should be followed. */ public synchronized void setFollowSymlinks(boolean followSymlinks) { if (isReference()) { throw tooManyAttributes(); } this.followSymlinks = followSymlinks; directoryScanner = null; }
/** * Sets whether default exclusions should be used or not. * * @param useDefaultExcludes <code>boolean</code>. */ public synchronized void setDefaultexcludes(boolean useDefaultExcludes) { if (isReference()) { throw tooManyAttributes(); } this.useDefaultExcludes = useDefaultExcludes; directoryScanner = null; }
/** * Sets case sensitivity of the file system. * * @param caseSensitive <code>boolean</code>. */ public synchronized void setCaseSensitive(boolean caseSensitive) { if (isReference()) { throw tooManyAttributes(); } this.caseSensitive = caseSensitive; directoryScanner = null; }
/** * Creates a nested patternset. * @return <code>PatternSet</code>. */ public synchronized PatternSet createPatternSet() { if (isReference()) { throw noChildrenAllowed(); } PatternSet patterns = new PatternSet(); additionalPatterns.add(patterns); directoryScanner = null; return patterns; }
/** * Add a new selector into this container. * * @param selector the new <code>FileSelector</code> to add. */ @Override public synchronized void appendSelector(FileSelector selector) { if (isReference()) { throw noChildrenAllowed(); } selectors.add(selector); directoryScanner = null; setChecked(false); }
/** * Add a name entry to the exclude list. * @return <code>PatternSet.NameEntry</code>. */ public synchronized PatternSet.NameEntry createExclude() { if (isReference()) { throw noChildrenAllowed(); } directoryScanner = null; return defaultPatterns.createExclude(); }
/** * Add a name entry to the excludes files list. * @return <code>PatternSet.PatternFileNameEntry</code>. */ public synchronized PatternSet.NameEntry createExcludesFile() { if (isReference()) { throw noChildrenAllowed(); } directoryScanner = null; return defaultPatterns.createExcludesFile(); }
/** * Add a name entry to the include list. * @return <code>PatternSet.NameEntry</code>. */ public synchronized PatternSet.NameEntry createInclude() { if (isReference()) { throw noChildrenAllowed(); } directoryScanner = null; return defaultPatterns.createInclude(); }
/** * Add a name entry to the include files list. * @return <code>PatternSet.PatternFileNameEntry</code>. */ public synchronized PatternSet.NameEntry createIncludesFile() { if (isReference()) { throw noChildrenAllowed(); } directoryScanner = null; return defaultPatterns.createIncludesFile(); }
/** * Sets the <code>File</code> containing the includes patterns. * * @param incl <code>File</code> instance. * @throws BuildException on error */ public synchronized void setIncludesfile(File incl) throws BuildException { if (isReference()) { throw tooManyAttributes(); } defaultPatterns.setIncludesfile(incl); directoryScanner = null; }
/** * Sets the <code>File</code> containing the excludes patterns. * * @param excl <code>File</code> instance. * @throws BuildException on error */ public synchronized void setExcludesfile(File excl) throws BuildException { if (isReference()) { throw tooManyAttributes(); } defaultPatterns.setExcludesfile(excl); directoryScanner = null; }
/** * Appends <code>excludes</code> to the current list of exclude * patterns. * * <p>Patterns may be separated by a comma or a space.</p> * * @param excludes the <code>String</code> containing the exclude patterns. */ public synchronized void setExcludes(String excludes) { if (isReference()) { throw tooManyAttributes(); } defaultPatterns.setExcludes(excludes); directoryScanner = null; }
/** * Returns the set of selectors as an array. * @param p the current project * @return a <code>FileSelector[]</code> of the selectors in this container. */ @Override public synchronized FileSelector[] getSelectors(Project p) { if (isReference()) { return getRef(getProject()).getSelectors(p); } dieOnCircularReference(p); return selectors.toArray(new FileSelector[selectors.size()]); }
/** * Returns included files as a list of semicolon-separated filenames. * * @return a <code>String</code> of included filenames. */ @Override public String toString() { if (isReference()) { return getRef(getProject()).toString(); } dieOnCircularReference(); DirectoryScanner ds = getDirectoryScanner(getProject()); return Stream.of(ds.getIncludedFiles()).collect(Collectors.joining(";")); }
/** * Returns an enumerator for accessing the set of selectors. * * @return an <code>Enumeration</code> of selectors. */ @Override public synchronized Enumeration<FileSelector> selectorElements() { if (isReference()) { return getRef(getProject()).selectorElements(); } dieOnCircularReference(); return Collections.enumeration(selectors); }
/** * 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; }
/** * Indicates whether there are any selectors here. * * @return whether any selectors are in this container. */ @Override public synchronized boolean hasSelectors() { if (isReference()) { return getRef(getProject()).hasSelectors(); } dieOnCircularReference(); return !selectors.isEmpty(); }
/** * Gives the count of the number of selectors in this container. * * @return the number of selectors in this container as an <code>int</code>. */ @Override public synchronized int selectorCount() { if (isReference()) { return getRef(getProject()).selectorCount(); } dieOnCircularReference(); return selectors.size(); }
/** * Whether default exclusions should be used or not. * @return the default exclusions value. * @since Ant 1.6.3 */ public synchronized boolean getDefaultexcludes() { if (isReference()) { return getRef(getProject()).getDefaultexcludes(); } dieOnCircularReference(); return useDefaultExcludes; }
/** * Indicates whether there are any patterns here. * * @return whether any patterns are in this container. */ public synchronized boolean hasPatterns() { if (isReference() && getProject() != null) { return getRef(getProject()).hasPatterns(); } dieOnCircularReference(); return defaultPatterns.hasPatterns(getProject()) || additionalPatterns.stream().anyMatch(ps -> ps.hasPatterns(getProject())); }