@@ -0,0 +1,2052 @@
+package jetty;%0A%0Aimport org.eclipse.jetty.server.Handler;%0Aimport org.eclipse.jetty.server.Server;%0Aimport org.eclipse.jetty.server.handler.DefaultHandler;%0Aimport org.eclipse.jetty.server.handler.HandlerList;%0Aimport org.eclipse.jetty.server.handler.ResourceHandler;%0A%0A// http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/examples/embedded/src/main/java/org/eclipse/jetty/embedded/FileServer.java%0Apublic class FileServer %7B%0A    %0A    public static void main(String%5B%5D args) throws Exception %7B%0A        // Create a basic Jetty server object that will listen on port 8080.  Note that if you set this to port 0%0A        // then a randomly available port will be assigned that you can either look in the logs for the port,%0A        // or programmatically obtain it for use in test cases.%0A        Server server = new Server(8080);%0A%0A        // Create the ResourceHandler. It is the object that will actually handle the request for a given file. It is%0A        // a Jetty Handler object so it is suitable for chaining with other handlers as you will see in other examples.%0A        ResourceHandler resource_handler = new ResourceHandler();%0A        // Configure the ResourceHandler. Setting the resource base indicates where the files should be served out of.%0A        // In this example it is the current directory but it can be configured to anything that the jvm has access to.%0A        resource_handler.setDirectoriesListed(true);%0A        resource_handler.setWelcomeFiles(new String%5B%5D%7B %22index.html%22 %7D);%0A        resource_handler.setResourceBase(%22.%22);%0A%0A        // Add the ResourceHandler to the server.%0A        HandlerList handlers = new HandlerList();%0A        handlers.setHandlers(new Handler%5B%5D %7B resource_handler, new DefaultHandler() %7D);%0A        server.setHandler(handlers);%0A%0A        // Start things up! By using the server.join() the server thread will join with the current thread.%0A        // See %22http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html#join()%22 for more details.%0A        server.start();%0A        server.join();%0A    %7D%0A    %0A%7D%0A

add FileServer.java