ptolemy.vergil.actor
Class FindPackages

java.lang.Object
  extended by ptolemy.vergil.actor.FindPackages

public class FindPackages
extends java.lang.Object

Look for class files under a directory and return package names.

Since:
Ptolemy II 5.2
Version:
$Id: FindPackages.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Christopher Brooks
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Nested Class Summary
private static class FindPackages.ClassFileFilter
          Filter that returns true if the pathname ends with .class.
private static class FindPackages.DirectoryFileFilter
          Filter that returns true if the pathname is a directory.
 
Constructor Summary
FindPackages()
           
 
Method Summary
private static void _getDirectories(java.io.File directory, java.util.Set directoriesSeen, java.util.Set classFilesSeen)
          Recursivly descend the filesystem.
static java.lang.String findPackages(java.io.File ptII, ExecuteCommands executeCommands)
          Look for class files under a directory and return package names.
static void main(java.lang.String[] args)
          Print out any packages found under the directory named by the first argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindPackages

public FindPackages()
Method Detail

findPackages

public static java.lang.String findPackages(java.io.File ptII,
                                            ExecuteCommands executeCommands)
Look for class files under a directory and return package names. Directories that end in adm, CVS and vendors are skipped.

Parameters:
ptII - The File under which to look for classes.
executeCommands - The ExecuteCommands object in which to report status. If null, then print to standard out.
Returns:
A string of space separated package names, relative to the File named by the ptII argument.

main

public static void main(java.lang.String[] args)
Print out any packages found under the directory named by the first argument.

Usage: java -classpath $PTII ptolemy.vergil.actor.FindPackages $PTII

Parameters:
args - An array of Strings, where the first argument is a string that names the directory under which we search for packages.

_getDirectories

private static void _getDirectories(java.io.File directory,
                                    java.util.Set directoriesSeen,
                                    java.util.Set classFilesSeen)
Recursivly descend the filesystem. Directories that end in adm, CVS and vendors are skipped.

Parameters:
directory - The top level directory.
directoriesSeen - A Set of objects of type File that name directories that have been seen.