/** * Get the complete list of files to be included in the cab. Filenames * are gathered from the fileset if it has been added, otherwise from the * traditional include parameters. * @return the list of files. * @throws BuildException if there is an error. */ protected Vector<String> getFileList() throws BuildException { Vector<String> files = new Vector<>(); if (baseDir != null) { // get files from old methods - includes and nested include appendFiles(files, super.getDirectoryScanner(baseDir)); } else { baseDir = fileset.getDir(); appendFiles(files, fileset.getDirectoryScanner(getProject())); } return files; }
/** * Initialize internal instance of XMLCatalog. * Initialize XPath for parameter evaluation. * @throws BuildException on error */ @Override public void init() throws BuildException { super.init(); xmlCatalog.setProject(getProject()); xpathFactory = XPathFactory.newInstance(); xpath = xpathFactory.newXPath(); xpath.setXPathVariableResolver( variableName -> getProject().getProperty(variableName.toString())); }
/** * List of filenames and directory names to not include. They should be * either comma or space separated. The ignored files will be logged. * * @param ignoreString the string containing the files to ignore. */ public void XsetIgnore(String ignoreString) { log("The ignore attribute is deprecated." + "Please use the excludes attribute.", Project.MSG_WARN); if (ignoreString != null && !ignoreString.isEmpty()) { StringTokenizer tok = new StringTokenizer(ignoreString, ", ", false); while (tok.hasMoreTokens()) { createExclude().setName("**/" + tok.nextToken().trim() + "/**"); } } }
/** * Set this to be the items in the base directory that you want to be * included. You can also specify "*" for the items (ie: items="*") * and it will include all the items in the base directory. * * @param itemString the string containing the files to include. */ public void XsetItems(String itemString) { log("The items attribute is deprecated. " + "Please use the includes attribute.", Project.MSG_WARN); if (itemString == null || "*".equals(itemString) || ".".equals(itemString)) { createInclude().setName("**"); } else { StringTokenizer tok = new StringTokenizer(itemString, ", "); while (tok.hasMoreTokens()) { String pattern = tok.nextToken().trim(); if (!pattern.isEmpty()) { createInclude().setName(pattern + "/**"); } } } }
task = jarTask; task.setProject(antProject); task.setIncludes(includes); task.setExcludes(excludes); task.execute();
throw new IllegalArgumentException("Unknown target type: " + artifact.getType()); archiver.setProject(project); archiver.execute(); return dest;
/** * Sets the set of include patterns. Patterns may be separated by a comma * or a space. * * @param includes the string containing the include patterns */ @Override public void setIncludes(String includes) { usedMatchingTask = true; super.setIncludes(includes); }
/** * Sets the set of exclude patterns. Patterns may be separated by a comma * or a space. * * @param excludes the string containing the exclude patterns */ @Override public void setExcludes(String excludes) { usedMatchingTask = true; super.setExcludes(excludes); }
super.log("Source files encoding is: " + new String(getEncoding().getBytes(getEncoding()), getEncoding()), Project.MSG_VERBOSE);
public void execute() throws BuildException super.execute();
DirectoryScanner ds = super.getDirectoryScanner(srcDir);
public void init() { super.init(); utility = Utility.getInstance(getProject(), this); condition = new Conditional(getProject()); sourceDir = getProject().resolveFile("."); createInclude().setName("**/*.java"); }
= this.destinationPackage.replace('.', File.separatorChar); DirectoryScanner ds = super.getDirectoryScanner(sourceDirectory);
DirectoryScanner ds = super.getDirectoryScanner(dir); for (String src : ds.getIncludedFiles()) { File file = new File(dir, src);
/** * Executes the task. * @throws BuildException on error. */ @Override public void execute() throws BuildException { // first off, make sure that we've got a srcdir and destdir validate(); // log options used String enc = encoding == null ? "default" : encoding; log("options:" + " eol=" + filter.getEol().getValue() + " tab=" + filter.getTab().getValue() + " eof=" + filter.getEof().getValue() + " tablength=" + filter.getTablength() + " encoding=" + enc + " outputencoding=" + (outputEncoding == null ? enc : outputEncoding), Project.MSG_VERBOSE); DirectoryScanner ds = super.getDirectoryScanner(srcDir); for (String filename : ds.getIncludedFiles()) { processFile(filename); } }
/** * Builds a list of all files to be analysed. We need to do this when * testing thresholds as the Javancss object does not have a constructor * that lets us make use of the -recursive option */ private List<File> findFilesToAnalyse() { DirectoryScanner ds = super.getDirectoryScanner(srcdir); String[] files = ds.getIncludedFiles(); if (files.length == 0) { log("No files in specified directory " + srcdir, 3); } return copyFiles(files); }
scanner = getDirectoryScanner(baseDir);
DirectoryScanner ds = super.getDirectoryScanner(srcDir); String[] files = ds.getIncludedFiles(); SourceFileScanner sfs = new SourceFileScanner(this);
DirectoryScanner ds = super.getDirectoryScanner(srcDir); String[] files = ds.getIncludedFiles(); SourceFileScanner sfs = new SourceFileScanner(this);
DirectoryScanner ds = super.getDirectoryScanner(dir); String[] srcs = ds.getIncludedFiles();