@Override
public InputStream getManualDocument(String command)
{
try (ShellContextImpl context = shell.createUIContext())
{
UICommand cmd = manager.getCommandByName(context, command);
if (cmd != null)
{
URL docLocation = cmd.getMetadata(context).getDocLocation();
if (docLocation != null)
{
try
{
return docLocation.openStream();
}
catch (IOException e)
{
log.log(Level.SEVERE,
"Could not open man page document stream URL [" + docLocation.toExternalForm()
+ "] for command [" + cmd.getMetadata(context).getType().getName() + "].", e);
}
}
return buildDefaultManPage(cmd, context);
}
}