// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/Configuration.java
// public interface Configuration {
// 
//     boolean isHeadless();
// 
//     void setHeadless(boolean headless);
// 
//     String getContextPath();
// 
//     void setContextPath(String contextPath);
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/JettyConsolePlugin.java
// public interface JettyConsolePlugin {
//     
//      List<StartOption> getStartOptions();
//      void beforeStart(WebAppContext context);
//      void beforeStop(WebAppContext context);
// 
//      void customizeServer(Server server);
// 
//      void customizeConnector(ServerConnector connector);
// 
//      void bootstrap();
// 
//      void configureConsole(Configuration configuration);
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/Settings.java
// public interface Settings {
//     String getProperty(String name);
//     Collection<String> getPropertyNames();
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/StartOption.java
// public interface StartOption {
// 
//     String getName();
// 
//     String validate(String arg);
// 
//     String validate();
// }
// 
// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/io/MultiOutputStream.java
// public class MultiOutputStream extends OutputStream {
// 
//     private List outputStreams = new ArrayList();
// 
//     public MultiOutputStream(OutputStream stream) {
//         outputStreams.add(stream);
//     }
// 
//     public void addOutputStream(OutputStream stream) {
//         outputStreams.add(stream);
//     }
// 
//     public void write(int i) throws IOException {
//         for (int j = 0; j < outputStreams.size(); j++) {
//             OutputStream stream = (OutputStream) outputStreams.get(j);
//             stream.write(i);
//         }
//     }
// 
//     public void write(byte[] bytes) throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.write(bytes);
//         }
//     }
// 
//     public void write(byte[] bytes, int i, int i1) throws IOException {
//         for (int j = 0; j < outputStreams.size(); j++) {
//             OutputStream stream = (OutputStream) outputStreams.get(j);
//             stream.write(bytes, i, i1);
//         }
//     }
// 
//     public void flush() throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.flush();
//         }
//     }
// 
//     public void close() throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.close();
//         }
//     }
// }
// 
// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java
// public static void usage() {
//     usage(null);
// }


import org.eclipse.jetty.util.IO;
import org.kantega.jexmec.ServiceKey;
import org.kantega.jexmec.ctor.ConstructorInjectionPluginLoader;
import org.kantega.jexmec.manager.DefaultPluginManager;
import org.simplericity.jettyconsole.api.Configuration;
import org.simplericity.jettyconsole.api.JettyConsolePlugin;
import org.simplericity.jettyconsole.api.Settings;
import org.simplericity.jettyconsole.api.StartOption;
import org.simplericity.jettyconsole.io.MultiOutputStream;
import org.simplericity.macify.eawt.Application;
import org.simplericity.macify.eawt.ApplicationAdapter;
import org.simplericity.macify.eawt.ApplicationEvent;
import org.simplericity.macify.eawt.DefaultApplication;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;
import static org.simplericity.jettyconsole.JettyConsoleBootstrapMainClass.usage;
                usage("Options must start with '--': " + arg);
            }
            arg = arg.substring(2);

            StartOption option = pluginOptions.get(arg.toLowerCase());

            if (option == null) {
                usage("Unknown option: '" + arg +"'");
            }

            JettyConsoleBootstrapMainClass.Option declaredOption = declaredOptions.get(option.getName().toLowerCase());


            if (declaredOption != null && declaredOption.getSample() != null) {
                if (i == args.length - 1) {
                    usage("--" + arg +" option requires a value");
                } else {
                    String errorMessage = option.validate(args[++i].trim());
                    if (errorMessage != null) {
                        usage(errorMessage);
                    }

                }
            } else {
                option.validate();
            }
        }
        return configuration;
    }

// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/Configuration.java
// public interface Configuration {
// 
//     boolean isHeadless();
// 
//     void setHeadless(boolean headless);
// 
//     String getContextPath();
// 
//     void setContextPath(String contextPath);
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/JettyConsolePlugin.java
// public interface JettyConsolePlugin {
//     
//      List<StartOption> getStartOptions();
//      void beforeStart(WebAppContext context);
//      void beforeStop(WebAppContext context);
// 
//      void customizeServer(Server server);
// 
//      void customizeConnector(ServerConnector connector);
// 
//      void bootstrap();
// 
//      void configureConsole(Configuration configuration);
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/Settings.java
// public interface Settings {
//     String getProperty(String name);
//     Collection<String> getPropertyNames();
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/StartOption.java
// public interface StartOption {
// 
//     String getName();
// 
//     String validate(String arg);
// 
//     String validate();
// }
// 
// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/io/MultiOutputStream.java
// public class MultiOutputStream extends OutputStream {
// 
//     private List outputStreams = new ArrayList();
// 
//     public MultiOutputStream(OutputStream stream) {
//         outputStreams.add(stream);
//     }
// 
//     public void addOutputStream(OutputStream stream) {
//         outputStreams.add(stream);
//     }
// 
//     public void write(int i) throws IOException {
//         for (int j = 0; j < outputStreams.size(); j++) {
//             OutputStream stream = (OutputStream) outputStreams.get(j);
//             stream.write(i);
//         }
//     }
// 
//     public void write(byte[] bytes) throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.write(bytes);
//         }
//     }
// 
//     public void write(byte[] bytes, int i, int i1) throws IOException {
//         for (int j = 0; j < outputStreams.size(); j++) {
//             OutputStream stream = (OutputStream) outputStreams.get(j);
//             stream.write(bytes, i, i1);
//         }
//     }
// 
//     public void flush() throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.flush();
//         }
//     }
// 
//     public void close() throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.close();
//         }
//     }
// }
// 
// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleBootstrapMainClass.java
// public static void usage() {
//     usage(null);
// }


// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsoleStarter.java
import org.eclipse.jetty.util.IO;
import org.kantega.jexmec.ServiceKey;
import org.kantega.jexmec.ctor.ConstructorInjectionPluginLoader;
import org.kantega.jexmec.manager.DefaultPluginManager;
import org.simplericity.jettyconsole.api.Configuration;
import org.simplericity.jettyconsole.api.JettyConsolePlugin;
import org.simplericity.jettyconsole.api.Settings;
import org.simplericity.jettyconsole.api.StartOption;
import org.simplericity.jettyconsole.io.MultiOutputStream;
import org.simplericity.macify.eawt.Application;
import org.simplericity.macify.eawt.ApplicationAdapter;
import org.simplericity.macify.eawt.ApplicationEvent;
import org.simplericity.macify.eawt.DefaultApplication;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;
import static org.simplericity.jettyconsole.JettyConsoleBootstrapMainClass.usage;

                usage("Options must start with '--': " + arg);
            }
            arg = arg.substring(2);

            StartOption option = pluginOptions.get(arg.toLowerCase());

            if (option == null) {
                usage("Unknown option: '" + arg +"'");
            }

            JettyConsoleBootstrapMainClass.Option declaredOption = declaredOptions.get(option.getName().toLowerCase());


            if (declaredOption != null && declaredOption.getSample() != null) {
                if (i == args.length - 1) {
                    usage("--" + arg +" option requires a value");
                } else {
                    String errorMessage = option.validate(args[++i].trim());
                    if (errorMessage != null) {
                        usage(errorMessage);
                    }

                }
            } else {
                option.validate();
            }
        }
        return configuration;
    }

    private Map<String, StartOption> createOptionByNameMap() {