Class CLI

java.lang.Object
net.shibboleth.idp.cli.CLI

public final class CLI extends Object
Entry point for generic command line utility.
  • Field Details

  • Constructor Details

    • CLI

      private CLI()
      Constructor.
  • Method Details

    • main

      public static void main(@Nonnull String[] args) throws ReflectiveOperationException, SecurityException, IllegalArgumentException
      Command line entry point.
      Parameters:
      args - command line arguments
      Throws:
      SecurityException - from the object construction
      ReflectiveOperationException - from the object construction
      IllegalArgumentException - from the object construction
    • doRequest

      private static void doRequest(@Nonnull CommandLineArguments args)
      Make a request using the arguments established.
      Parameters:
      args - the populated command line arguments
    • outputStream

      private static void outputStream(@Nonnull InputStream source, @Nonnull PrintStream sink) throws IOException
      Dump contents of stream to an output sink.
      Parameters:
      source - input stream to dump
      sink - output stream to write to
      Throws:
      IOException - if an error occurs
    • errorAndExit

      private static void errorAndExit(@Nonnull String errorMessage, @Nullable HttpURLConnection conn)
      Logs, as an error, the error message, any error stream content from the connection, and exits the program.
      Parameters:
      errorMessage - error message
      conn - connection to get error information from