public class ClasspathPackages extends Object
Constructor and Description |
---|
ClasspathPackages() |
Modifier and Type | Method and Description |
---|---|
private static void |
addPackage(JarEntry entry,
Set packages)
Adds the package of the class named by the JAR entry, if any
|
private static void |
addPackages(String top,
String dir,
Set packages)
Adds packages of classes recursively located in the directory, using the
top argument to specify the top level directory containing the package
hierarchy.
|
static Set |
compute(String classpath)
Computes the packages in the specified class path.
|
static void |
main(String[] args)
Prints the packages in the class path to standard output using the
default character encoding.
|
public static void main(String[] args)
args
- the argumentspublic static Set compute(String classpath)
File.pathSeparator
character. Empty names are
treated as the current directory, names ending in the File.separator
character are treated as directories, and
other names are treated as JAR files. Directories or JAR files that
have errors when they are accessed will be ignored.classpath
- the class pathprivate static void addPackages(String top, String dir, Set packages)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.