MCPcopy
hub / github.com/zaproxy/zaproxy / main

Method main

zap/src/main/java/org/zaproxy/zap/ZAP.java:82–109  ·  view source on GitHub ↗

Main method @param args the arguments passed to the command line version @throws Exception if something wrong happens

(String[] args)

Source from the content-addressed store, hash-verified

80 * @throws Exception if something wrong happens
81 */
82 public static void main(String[] args) throws Exception {
83 setCustomErrStream();
84
85 CommandLine cmdLine = null;
86 try {
87 cmdLine = new CommandLine(args != null ? Arrays.copyOf(args, args.length) : null);
88
89 } catch (final Exception e) {
90 // Cant use the CommandLine help here as the
91 // i18n messages wont have been loaded
92 System.out.println("Failed due to invalid parameters: " + Arrays.toString(args));
93 System.out.println(e.getMessage());
94 System.out.println("Use '-h' for more details.");
95 System.exit(1);
96 }
97
98 ZapBootstrap bootstrap = createZapBootstrap(cmdLine);
99 try {
100 int rc = bootstrap.start();
101 if (rc != 0) {
102 System.exit(rc);
103 }
104
105 } catch (final Exception e) {
106 LOGGER.fatal(e.getMessage(), e);
107 System.exit(1);
108 }
109 }
110
111 private static void setCustomErrStream() {
112 System.setErr(

Callers

nothing calls this directly

Calls 7

setCustomErrStreamMethod · 0.95
createZapBootstrapMethod · 0.95
startMethod · 0.95
getMessageMethod · 0.65
printlnMethod · 0.45
toStringMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected