The main program for the bootstrap. @param args Command line arguments to be processed
(String[] args)
| 113 | * @param args Command line arguments to be processed |
| 114 | */ |
| 115 | @SuppressWarnings("null") |
| 116 | public static void main(String[] args) { |
| 117 | |
| 118 | // Verify that "catalina.home" was passed. |
| 119 | if (catalinaHome == null) { |
| 120 | log.error("Must set '" + Constants.CATALINA_HOME_PROP + "' system property"); |
| 121 | System.exit(1); |
| 122 | } |
| 123 | |
| 124 | // Process command line options |
| 125 | int index = 0; |
| 126 | label: |
| 127 | while (true) { |
| 128 | if (index == args.length) { |
| 129 | usage(); |
| 130 | System.exit(1); |
| 131 | } |
| 132 | switch (args[index]) { |
| 133 | case "-ant": |
| 134 | ant = true; |
| 135 | break; |
| 136 | case "-common": |
| 137 | common = true; |
| 138 | break; |
| 139 | case "-server": |
| 140 | server = true; |
| 141 | break; |
| 142 | case "-shared": |
| 143 | shared = true; |
| 144 | break; |
| 145 | default: |
| 146 | break label; |
| 147 | } |
| 148 | index++; |
| 149 | } |
| 150 | |
| 151 | // Set "ant.home" if requested |
| 152 | if (ant) { |
| 153 | System.setProperty("ant.home", catalinaHome); |
| 154 | } |
| 155 | |
| 156 | // Construct the class loader we will be using |
| 157 | ClassLoader classLoader = null; |
| 158 | try { |
| 159 | List<File> packed = new ArrayList<>(); |
| 160 | List<File> unpacked = new ArrayList<>(); |
| 161 | unpacked.add(new File(catalinaHome, "classes")); |
| 162 | packed.add(new File(catalinaHome, "lib")); |
| 163 | if (common) { |
| 164 | unpacked.add(new File(catalinaHome, "common" + File.separator + "classes")); |
| 165 | packed.add(new File(catalinaHome, "common" + File.separator + "lib")); |
| 166 | } |
| 167 | if (server) { |
| 168 | unpacked.add(new File(catalinaHome, "server" + File.separator + "classes")); |
| 169 | packed.add(new File(catalinaHome, "server" + File.separator + "lib")); |
| 170 | } |
| 171 | if (shared) { |
| 172 | unpacked.add(new File(catalinaHome, "shared" + File.separator + "classes")); |
nothing calls this directly
no test coverage detected