Package net.shibboleth.idp.cli
Class CLI
java.lang.Object
net.shibboleth.idp.cli.CLI
Entry point for generic command line utility.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of system property for command line argument class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidMake a request using the arguments established.private static voiderrorAndExit(String errorMessage, HttpURLConnection conn) Logs, as an error, the error message, any error stream content from the connection, and exits the program.static voidCommand line entry point.private static voidoutputStream(InputStream source, PrintStream sink) Dump contents of stream to an output sink.
-
Field Details
-
ARGS_PROPERTY
Name of system property for command line argument class.- See Also:
-
-
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 constructionReflectiveOperationException- from the object constructionIllegalArgumentException- from the object construction
-
doRequest
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 dumpsink- output stream to write to- Throws:
IOException- if an error occurs
-
errorAndExit
Logs, as an error, the error message, any error stream content from the connection, and exits the program.- Parameters:
errorMessage- error messageconn- connection to get error information from
-