Package org.glassfish.common.util.admin
Class ManPageFinder
java.lang.Object
org.glassfish.common.util.admin.ManPageFinder
A utility class that gets the plain text man page for the
given command. It searches (using Class.getResource()) for
the pages, and returns the first one found.
For any given man page multiple instances of that page can exist.
Man pages are come in sections (1 through 9, 1m through 9m),
locales (language, country, variant), and by command version.
These instances are ordered by section number (1 - 9, 1m * - 9m),
local specificity (most specific to least specific) and then by
version (later versions before earlier versions).
This is probably not what is wanted (I think what is
wanted is versions before sections before language specificity),
but is this way because of the way the Java Class.getResource()
mechanism works.
All methods will throw a NullPointerException if given null object
arguments.
All methods will throw an IllegalArgumentException if their
arguments are non-null but are otherwise meaningless.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedReadergetCommandManPage(String cmdName, String cmdClass, Locale locale, ClassLoader classLoader, Logger logger) Get the man page for the given command for the given locale using the given classloader.
-
Method Details
-
getCommandManPage
public static BufferedReader getCommandManPage(String cmdName, String cmdClass, Locale locale, ClassLoader classLoader, Logger logger) Get the man page for the given command for the given locale using the given classloader.- Parameters:
cmdName- the command namecmdClass- the command classlocale- the locale to be used to find the man pageclassLoader- the class loader to be used to find the man page
-