use of org.apache.tools.ant.types.FileSet in project jetty.project by eclipse.
the class AntWebAppContext method getLibrariesConfiguration.
/**
* @return a <code>FileMatchingConfiguration</code> object describing the
* configuration of all libraries added to this particular web app
* (both classes and libraries).
*/
public FileMatchingConfiguration getLibrariesConfiguration() {
FileMatchingConfiguration config = new FileMatchingConfiguration();
Iterator classesIterator = classes.iterator();
while (classesIterator.hasNext()) {
FileSet clazz = (FileSet) classesIterator.next();
config.addDirectoryScanner(clazz.getDirectoryScanner(project));
}
Iterator librariesIterator = libraries.iterator();
while (librariesIterator.hasNext()) {
FileSet library = (FileSet) librariesIterator.next();
config.addDirectoryScanner(library.getDirectoryScanner(project));
}
return config;
}
use of org.apache.tools.ant.types.FileSet in project tomcat by apache.
the class SignCode method execute.
@Override
public void execute() throws BuildException {
List<File> filesToSign = new ArrayList<>();
// signed.
for (FileSet fileset : filesets) {
DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
File basedir = ds.getBasedir();
String[] files = ds.getIncludedFiles();
if (files.length > 0) {
for (int i = 0; i < files.length; i++) {
File file = new File(basedir, files[i]);
filesToSign.add(file);
}
}
}
try {
String signingSetID = makeSigningRequest(filesToSign);
downloadSignedFiles(filesToSign, signingSetID);
} catch (SOAPException | IOException e) {
throw new BuildException(e);
}
}
use of org.apache.tools.ant.types.FileSet in project JessMA by ldcsaa.
the class Zipper method getSourceFileSet.
private FileSet getSourceFileSet() {
File f = new File(source);
FileSet fs = new FileSet();
fillFileSetAttributes(fs, f);
return fs;
}
use of org.apache.tools.ant.types.FileSet in project lombok by rzwitserloot.
the class WebUpToDate method eval.
/**
* Evaluate (all) target and source file(s) to
* see if the target(s) is/are up-to-date.
* @return true if the target(s) is/are up-to-date
*/
public boolean eval() {
if (sourceFileSets.size() == 0 && sourceResources.size() == 0 && sourceFile == null) {
throw new BuildException("At least one srcfile or a nested <srcfiles> or <srcresources> element must be set.");
}
if ((sourceFileSets.size() > 0 || sourceResources.size() > 0) && sourceFile != null) {
throw new BuildException("Cannot specify both the srcfile attribute and a nested <srcfiles> or <srcresources> element.");
}
if (urlbase == null) {
throw new BuildException("The urlbase attribute must be set.");
}
// if the source file isn't there, throw an exception
if (sourceFile != null && !sourceFile.exists()) {
throw new BuildException(sourceFile.getAbsolutePath() + " not found.");
}
boolean upToDate = true;
if (sourceFile != null) {
Resource fileResource = new FileResource(sourceFile);
upToDate = isUpToDate(fileResource);
}
if (upToDate) {
Enumeration e = sourceFileSets.elements();
while (upToDate && e.hasMoreElements()) {
FileSet fs = (FileSet) e.nextElement();
Iterator it = fs.iterator();
while (upToDate && it.hasNext()) {
Resource r = (Resource) it.next();
upToDate = isUpToDate(r);
}
}
}
if (upToDate) {
Resource[] r = sourceResources.listResources();
for (int i = 0; upToDate && i < r.length; i++) {
upToDate = isUpToDate(r[i]);
}
}
return upToDate;
}
use of org.apache.tools.ant.types.FileSet in project hibernate-orm by hibernate.
the class SchemaExportTask method getFiles.
private String[] getFiles() {
List<String> files = new LinkedList<String>();
for (FileSet fileSet : fileSets) {
final DirectoryScanner ds = fileSet.getDirectoryScanner(getProject());
final String[] dsFiles = ds.getIncludedFiles();
for (String dsFileName : dsFiles) {
File f = new File(dsFileName);
if (!f.isFile()) {
f = new File(ds.getBasedir(), dsFileName);
}
files.add(f.getAbsolutePath());
}
}
return ArrayHelper.toStringArray(files);
}
Aggregations