Methods Summary |
---|
public void | addFileset(org.apache.tools.ant.types.FileSet fileSet)Adds a set of files about which library data will be displayed.
libraryFileSets.addElement(fileSet);
|
public void | execute()Execute the task.
validate();
final LibraryDisplayer displayer = new LibraryDisplayer();
// Check if list of files to check has been specified
if (!libraryFileSets.isEmpty()) {
final Iterator iterator = libraryFileSets.iterator();
while (iterator.hasNext()) {
final FileSet fileSet = (FileSet) iterator.next();
final DirectoryScanner scanner
= fileSet.getDirectoryScanner(getProject());
final File basedir = scanner.getBasedir();
final String[] files = scanner.getIncludedFiles();
for (int i = 0; i < files.length; i++) {
final File file = new File(basedir, files[ i ]);
displayer.displayLibrary(file);
}
}
} else {
displayer.displayLibrary(libraryFile);
}
|
public void | setFile(java.io.File file)The JAR library to display information for.
this.libraryFile = file;
|
private void | validate()Validate the tasks parameters.
if (null == libraryFile && libraryFileSets.isEmpty()) {
final String message = "File attribute not specified.";
throw new BuildException(message);
}
if (null != libraryFile && !libraryFile.exists()) {
final String message = "File '" + libraryFile + "' does not exist.";
throw new BuildException(message);
}
if (null != libraryFile && !libraryFile.isFile()) {
final String message = "\'" + libraryFile + "\' is not a file.";
throw new BuildException(message);
}
|