net.noderunner.amazon.s3.emulator
Class Server

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by net.noderunner.amazon.s3.emulator.Server
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class Server
extends javax.servlet.http.HttpServlet

Amazon S3 emulator that stores data in an internal sorted map. Not highly scalable or reliable, but may be fine for testing your application. Some browse methods are not complete. Get Data/Put/Head are mostly complete. What's supported is in the test suite.

Author:
Elias Ross
See Also:
Serialized Form

Constructor Summary
Server()
           
 
Method Summary
 void close()
          Closes socket, stops accepting requests.
protected  void doDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doHead(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 int getPort()
          Listening port.
 void log(java.lang.String s)
           
 void start()
          Starts accepting requests.
 java.lang.String toString()
          Returns a debug String.
 
Methods inherited from class javax.servlet.http.HttpServlet
doOptions, doPost, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Server

public Server()
       throws java.io.IOException
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Closes socket, stops accepting requests.

Throws:
java.io.IOException

doDelete

protected void doDelete(javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse resp)
                 throws javax.servlet.ServletException,
                        java.io.IOException
Overrides:
doDelete in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

getPort

public int getPort()
Listening port.


start

public void start()
Starts accepting requests.


doGet

protected void doGet(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse resp)
              throws javax.servlet.ServletException,
                     java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doHead

protected void doHead(javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse resp)
               throws javax.servlet.ServletException,
                      java.io.IOException
Overrides:
doHead in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

doPut

protected void doPut(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse resp)
              throws javax.servlet.ServletException,
                     java.io.IOException
Overrides:
doPut in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException

log

public void log(java.lang.String s)
Overrides:
log in class javax.servlet.GenericServlet

toString

public java.lang.String toString()
Returns a debug String.

Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.