changeset 813:f8f7cb485c25

remove UserIdentity
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 08 Sep 2016 22:01:33 -0600
parents 700317ba03ad
children 95cbe23a96fb
files src/org/eclipse/jetty/server/Authentication.java src/org/eclipse/jetty/server/NCSARequestLog.java src/org/eclipse/jetty/server/Request.java src/org/eclipse/jetty/server/Response.java src/org/eclipse/jetty/server/UserIdentity.java
diffstat 5 files changed, 1764 insertions(+), 1942 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/Authentication.java	Thu Sep 08 21:44:37 2016 -0600
+++ b/src/org/eclipse/jetty/server/Authentication.java	Thu Sep 08 22:01:33 2016 -0600
@@ -35,121 +35,119 @@
  */
 public interface Authentication
 {
-    /* ------------------------------------------------------------ */
-    /** A successful Authentication with User information.
-     */
-    public interface User extends Authentication
-    {
-        String getAuthMethod();
-        UserIdentity getUserIdentity(); 
-        boolean isUserInRole(UserIdentity.Scope scope,String role);
-        void logout();
-    }
-    
-    /* ------------------------------------------------------------ */
-    /** A wrapped authentication with methods provide the
-     * wrapped request/response for use by the application
-     */
-    public interface Wrapped extends Authentication
-    {
-        HttpServletRequest getHttpServletRequest();
-        HttpServletResponse getHttpServletResponse();
-    }
-    
-    /* ------------------------------------------------------------ */
-    /** A deferred authentication with methods to progress 
-     * the authentication process.
-     */
-    public interface Deferred extends Authentication
-    {
-        /* ------------------------------------------------------------ */
-        /** Authenticate if possible without sending a challenge.
-         * This is used to check credentials that have been sent for 
-         * non-manditory authentication.
-         * @return The new Authentication state.
-         */
-        Authentication authenticate(ServletRequest request);
+	/* ------------------------------------------------------------ */
+	/** A successful Authentication with User information.
+	 */
+	public interface User extends Authentication
+	{
+		String getAuthMethod();
+		void logout();
+	}
+	
+	/* ------------------------------------------------------------ */
+	/** A wrapped authentication with methods provide the
+	 * wrapped request/response for use by the application
+	 */
+	public interface Wrapped extends Authentication
+	{
+		HttpServletRequest getHttpServletRequest();
+		HttpServletResponse getHttpServletResponse();
+	}
+	
+	/* ------------------------------------------------------------ */
+	/** A deferred authentication with methods to progress 
+	 * the authentication process.
+	 */
+	public interface Deferred extends Authentication
+	{
+		/* ------------------------------------------------------------ */
+		/** Authenticate if possible without sending a challenge.
+		 * This is used to check credentials that have been sent for 
+		 * non-manditory authentication.
+		 * @return The new Authentication state.
+		 */
+		Authentication authenticate(ServletRequest request);
 
-        /* ------------------------------------------------------------ */
-        /** Authenticate and possibly send a challenge.
-         * This is used to initiate authentication for previously 
-         * non-manditory authentication.
-         * @return The new Authentication state.
-         */
-        Authentication authenticate(ServletRequest request,ServletResponse response);
-        
-        
-        /* ------------------------------------------------------------ */
-        /** Login with the LOGIN authenticator
-         * @param username
-         * @param password
-         * @return The new Authentication state
-         */
-        Authentication login(String username,Object password,ServletRequest request);
-    }
+		/* ------------------------------------------------------------ */
+		/** Authenticate and possibly send a challenge.
+		 * This is used to initiate authentication for previously 
+		 * non-manditory authentication.
+		 * @return The new Authentication state.
+		 */
+		Authentication authenticate(ServletRequest request,ServletResponse response);
+		
+		
+		/* ------------------------------------------------------------ */
+		/** Login with the LOGIN authenticator
+		 * @param username
+		 * @param password
+		 * @return The new Authentication state
+		 */
+		Authentication login(String username,Object password,ServletRequest request);
+	}
 
-    
-    /* ------------------------------------------------------------ */
-    /** Authentication Response sent state.
-     * Responses are sent by authenticators either to issue an
-     * authentication challenge or on successful authentication in
-     * order to redirect the user to the original URL.
-     */
-    public interface ResponseSent extends Authentication
-    { 
-    }
-    
-    /* ------------------------------------------------------------ */
-    /** An Authentication Challenge has been sent.
-     */
-    public interface Challenge extends ResponseSent
-    { 
-    }
+	
+	/* ------------------------------------------------------------ */
+	/** Authentication Response sent state.
+	 * Responses are sent by authenticators either to issue an
+	 * authentication challenge or on successful authentication in
+	 * order to redirect the user to the original URL.
+	 */
+	public interface ResponseSent extends Authentication
+	{ 
+	}
+	
+	/* ------------------------------------------------------------ */
+	/** An Authentication Challenge has been sent.
+	 */
+	public interface Challenge extends ResponseSent
+	{ 
+	}
 
-    /* ------------------------------------------------------------ */
-    /** An Authentication Failure has been sent.
-     */
-    public interface Failure extends ResponseSent
-    { 
-    }
+	/* ------------------------------------------------------------ */
+	/** An Authentication Failure has been sent.
+	 */
+	public interface Failure extends ResponseSent
+	{ 
+	}
 
-    public interface SendSuccess extends ResponseSent
-    {
-    }
+	public interface SendSuccess extends ResponseSent
+	{
+	}
 
-    /* ------------------------------------------------------------ */
-    /** Unauthenticated state.
-     * <p> 
-     * This convenience instance is for non mandatory authentication where credentials
-     * have been presented and checked, but failed authentication. 
-     */
-    public final static Authentication UNAUTHENTICATED = new Authentication(){@Override
-    public String toString(){return "UNAUTHENTICATED";}};
+	/* ------------------------------------------------------------ */
+	/** Unauthenticated state.
+	 * <p> 
+	 * This convenience instance is for non mandatory authentication where credentials
+	 * have been presented and checked, but failed authentication. 
+	 */
+	public final static Authentication UNAUTHENTICATED = new Authentication(){@Override
+	public String toString(){return "UNAUTHENTICATED";}};
 
-    /* ------------------------------------------------------------ */
-    /** Authentication not checked
-     * <p>
-     * This convenience instance us for non mandatory authentication when no 
-     * credentials are present to be checked.
-     */
-    public final static Authentication NOT_CHECKED = new Authentication(){@Override
-    public String toString(){return "NOT CHECKED";}};
+	/* ------------------------------------------------------------ */
+	/** Authentication not checked
+	 * <p>
+	 * This convenience instance us for non mandatory authentication when no 
+	 * credentials are present to be checked.
+	 */
+	public final static Authentication NOT_CHECKED = new Authentication(){@Override
+	public String toString(){return "NOT CHECKED";}};
 
-    /* ------------------------------------------------------------ */
-    /** Authentication challenge sent.
-     * <p>
-     * This convenience instance is for when an authentication challenge has been sent.
-     */
-    public final static Authentication SEND_CONTINUE = new Authentication.Challenge(){@Override
-    public String toString(){return "CHALLENGE";}};
+	/* ------------------------------------------------------------ */
+	/** Authentication challenge sent.
+	 * <p>
+	 * This convenience instance is for when an authentication challenge has been sent.
+	 */
+	public final static Authentication SEND_CONTINUE = new Authentication.Challenge(){@Override
+	public String toString(){return "CHALLENGE";}};
 
-    /* ------------------------------------------------------------ */
-    /** Authentication failure sent.
-     * <p>
-     * This convenience instance is for when an authentication failure has been sent.
-     */
-    public final static Authentication SEND_FAILURE = new Authentication.Failure(){@Override
-    public String toString(){return "FAILURE";}};
-    public final static Authentication SEND_SUCCESS = new SendSuccess(){@Override
-    public String toString(){return "SEND_SUCCESS";}};
+	/* ------------------------------------------------------------ */
+	/** Authentication failure sent.
+	 * <p>
+	 * This convenience instance is for when an authentication failure has been sent.
+	 */
+	public final static Authentication SEND_FAILURE = new Authentication.Failure(){@Override
+	public String toString(){return "FAILURE";}};
+	public final static Authentication SEND_SUCCESS = new SendSuccess(){@Override
+	public String toString(){return "SEND_SUCCESS";}};
 }
--- a/src/org/eclipse/jetty/server/NCSARequestLog.java	Thu Sep 08 21:44:37 2016 -0600
+++ b/src/org/eclipse/jetty/server/NCSARequestLog.java	Thu Sep 08 22:01:33 2016 -0600
@@ -52,675 +52,672 @@
  */
 public class NCSARequestLog extends AbstractLifeCycle implements RequestLog
 {
-    private static final Logger LOG = Log.getLogger(NCSARequestLog.class);
-    private static ThreadLocal<StringBuilder> _buffers = new ThreadLocal<StringBuilder>()
-            {
-                @Override
-                protected StringBuilder initialValue()
-                {
-                    return new StringBuilder(256);
-                }
-            };
+	private static final Logger LOG = Log.getLogger(NCSARequestLog.class);
+	private static ThreadLocal<StringBuilder> _buffers = new ThreadLocal<StringBuilder>()
+			{
+				@Override
+				protected StringBuilder initialValue()
+				{
+					return new StringBuilder(256);
+				}
+			};
 
-    private String _filename;
-    private boolean _extended;
-    private boolean _append;
-    private int _retainDays;
-    private boolean _closeOut;
-    private boolean _preferProxiedForAddress;
-    private String _logDateFormat = "dd/MMM/yyyy:HH:mm:ss Z";
-    private String _filenameDateFormat = null;
-    private Locale _logLocale = Locale.getDefault();
-    private String _logTimeZone = "GMT";
-    private String[] _ignorePaths;
-    private boolean _logLatency = false;
-    private boolean _logCookies = false;
-    private boolean _logServer = false;
-    private boolean _logDispatch = false;
+	private String _filename;
+	private boolean _extended;
+	private boolean _append;
+	private int _retainDays;
+	private boolean _closeOut;
+	private boolean _preferProxiedForAddress;
+	private String _logDateFormat = "dd/MMM/yyyy:HH:mm:ss Z";
+	private String _filenameDateFormat = null;
+	private Locale _logLocale = Locale.getDefault();
+	private String _logTimeZone = "GMT";
+	private String[] _ignorePaths;
+	private boolean _logLatency = false;
+	private boolean _logCookies = false;
+	private boolean _logServer = false;
+	private boolean _logDispatch = false;
 
-    private transient OutputStream _out;
-    private transient OutputStream _fileOut;
-    private transient DateCache _logDateCache;
-    private transient PathMap _ignorePathMap;
-    private transient Writer _writer;
+	private transient OutputStream _out;
+	private transient OutputStream _fileOut;
+	private transient DateCache _logDateCache;
+	private transient PathMap _ignorePathMap;
+	private transient Writer _writer;
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Create request log object with default settings.
-     */
-    public NCSARequestLog()
-    {
-        _extended = true;
-        _append = true;
-        _retainDays = 31;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Create request log object with default settings.
+	 */
+	public NCSARequestLog()
+	{
+		_extended = true;
+		_append = true;
+		_retainDays = 31;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Create request log object with specified output file name.
-     * 
-     * @param filename the file name for the request log.
-     *                 This may be in the format expected
-     *                 by {@link RolloverFileOutputStream}
-     */
-    public NCSARequestLog(String filename)
-    {
-        _extended = true;
-        _append = true;
-        _retainDays = 31;
-        setFilename(filename);
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Create request log object with specified output file name.
+	 * 
+	 * @param filename the file name for the request log.
+	 *                 This may be in the format expected
+	 *                 by {@link RolloverFileOutputStream}
+	 */
+	public NCSARequestLog(String filename)
+	{
+		_extended = true;
+		_append = true;
+		_retainDays = 31;
+		setFilename(filename);
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set the output file name of the request log.
-     * The file name may be in the format expected by
-     * {@link RolloverFileOutputStream}.
-     * 
-     * @param filename file name of the request log
-     *                
-     */
-    public void setFilename(String filename)
-    {
-        if (filename != null)
-        {
-            filename = filename.trim();
-            if (filename.length() == 0)
-                filename = null;
-        }
-        _filename = filename;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set the output file name of the request log.
+	 * The file name may be in the format expected by
+	 * {@link RolloverFileOutputStream}.
+	 * 
+	 * @param filename file name of the request log
+	 *                
+	 */
+	public void setFilename(String filename)
+	{
+		if (filename != null)
+		{
+			filename = filename.trim();
+			if (filename.length() == 0)
+				filename = null;
+		}
+		_filename = filename;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the output file name of the request log.
-     * 
-     * @return file name of the request log
-     */
-    public String getFilename()
-    {
-        return _filename;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the output file name of the request log.
+	 * 
+	 * @return file name of the request log
+	 */
+	public String getFilename()
+	{
+		return _filename;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the file name of the request log with the expanded
-     * date wildcard if the output is written to the disk using
-     * {@link RolloverFileOutputStream}.
-     * 
-     * @return file name of the request log, or null if not applicable
-     */
-    public String getDatedFilename()
-    {
-        if (_fileOut instanceof RolloverFileOutputStream)
-            return ((RolloverFileOutputStream)_fileOut).getDatedFilename();
-        return null;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the file name of the request log with the expanded
+	 * date wildcard if the output is written to the disk using
+	 * {@link RolloverFileOutputStream}.
+	 * 
+	 * @return file name of the request log, or null if not applicable
+	 */
+	public String getDatedFilename()
+	{
+		if (_fileOut instanceof RolloverFileOutputStream)
+			return ((RolloverFileOutputStream)_fileOut).getDatedFilename();
+		return null;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set the timestamp format for request log entries in the file.
-     * If this is not set, the pre-formated request timestamp is used.
-     * 
-     * @param format timestamp format string 
-     */
-    public void setLogDateFormat(String format)
-    {
-        _logDateFormat = format;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set the timestamp format for request log entries in the file.
+	 * If this is not set, the pre-formated request timestamp is used.
+	 * 
+	 * @param format timestamp format string 
+	 */
+	public void setLogDateFormat(String format)
+	{
+		_logDateFormat = format;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the timestamp format string for request log entries.
-     * 
-     * @return timestamp format string.
-     */
-    public String getLogDateFormat()
-    {
-        return _logDateFormat;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the timestamp format string for request log entries.
+	 * 
+	 * @return timestamp format string.
+	 */
+	public String getLogDateFormat()
+	{
+		return _logDateFormat;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set the locale of the request log.
-     * 
-     * @param logLocale locale object
-     */
-    public void setLogLocale(Locale logLocale)
-    {
-        _logLocale = logLocale;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set the locale of the request log.
+	 * 
+	 * @param logLocale locale object
+	 */
+	public void setLogLocale(Locale logLocale)
+	{
+		_logLocale = logLocale;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the locale of the request log.
-     * 
-     * @return locale object
-     */
-    public Locale getLogLocale()
-    {
-        return _logLocale;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the locale of the request log.
+	 * 
+	 * @return locale object
+	 */
+	public Locale getLogLocale()
+	{
+		return _logLocale;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set the timezone of the request log.
-     * 
-     * @param tz timezone string
-     */
-    public void setLogTimeZone(String tz)
-    {
-        _logTimeZone = tz;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set the timezone of the request log.
+	 * 
+	 * @param tz timezone string
+	 */
+	public void setLogTimeZone(String tz)
+	{
+		_logTimeZone = tz;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the timezone of the request log.
-     * 
-     * @return timezone string
-     */
-    public String getLogTimeZone()
-    {
-        return _logTimeZone;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the timezone of the request log.
+	 * 
+	 * @return timezone string
+	 */
+	public String getLogTimeZone()
+	{
+		return _logTimeZone;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set the number of days before rotated log files are deleted.
-     * 
-     * @param retainDays number of days to keep a log file
-     */
-    public void setRetainDays(int retainDays)
-    {
-        _retainDays = retainDays;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set the number of days before rotated log files are deleted.
+	 * 
+	 * @param retainDays number of days to keep a log file
+	 */
+	public void setRetainDays(int retainDays)
+	{
+		_retainDays = retainDays;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the number of days before rotated log files are deleted.
-     * 
-     * @return number of days to keep a log file
-     */
-    public int getRetainDays()
-    {
-        return _retainDays;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the number of days before rotated log files are deleted.
+	 * 
+	 * @return number of days to keep a log file
+	 */
+	public int getRetainDays()
+	{
+		return _retainDays;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set the extended request log format flag.
-     * 
-     * @param extended true - log the extended request information,
-     *                 false - do not log the extended request information
-     */
-    public void setExtended(boolean extended)
-    {
-        _extended = extended;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set the extended request log format flag.
+	 * 
+	 * @param extended true - log the extended request information,
+	 *                 false - do not log the extended request information
+	 */
+	public void setExtended(boolean extended)
+	{
+		_extended = extended;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the extended request log format flag.
-     * 
-     * @return value of the flag
-     */
-    public boolean isExtended()
-    {
-        return _extended;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the extended request log format flag.
+	 * 
+	 * @return value of the flag
+	 */
+	public boolean isExtended()
+	{
+		return _extended;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set append to log flag.
-     * 
-     * @param append true - request log file will be appended after restart,
-     *               false - request log file will be overwritten after restart
-     */
-    public void setAppend(boolean append)
-    {
-        _append = append;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set append to log flag.
+	 * 
+	 * @param append true - request log file will be appended after restart,
+	 *               false - request log file will be overwritten after restart
+	 */
+	public void setAppend(boolean append)
+	{
+		_append = append;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve append to log flag.
-     * 
-     * @return value of the flag
-     */
-    public boolean isAppend()
-    {
-        return _append;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve append to log flag.
+	 * 
+	 * @return value of the flag
+	 */
+	public boolean isAppend()
+	{
+		return _append;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set request paths that will not be logged.
-     * 
-     * @param ignorePaths array of request paths
-     */
-    public void setIgnorePaths(String[] ignorePaths)
-    {
-        _ignorePaths = ignorePaths;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set request paths that will not be logged.
+	 * 
+	 * @param ignorePaths array of request paths
+	 */
+	public void setIgnorePaths(String[] ignorePaths)
+	{
+		_ignorePaths = ignorePaths;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the request paths that will not be logged.
-     * 
-     * @return array of request paths
-     */
-    public String[] getIgnorePaths()
-    {
-        return _ignorePaths;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the request paths that will not be logged.
+	 * 
+	 * @return array of request paths
+	 */
+	public String[] getIgnorePaths()
+	{
+		return _ignorePaths;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Controls logging of the request cookies.
-     * 
-     * @param logCookies true - values of request cookies will be logged,
-     *                   false - values of request cookies will not be logged
-     */
-    public void setLogCookies(boolean logCookies)
-    {
-        _logCookies = logCookies;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Controls logging of the request cookies.
+	 * 
+	 * @param logCookies true - values of request cookies will be logged,
+	 *                   false - values of request cookies will not be logged
+	 */
+	public void setLogCookies(boolean logCookies)
+	{
+		_logCookies = logCookies;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve log cookies flag
-     * 
-     * @return value of the flag
-     */
-    public boolean getLogCookies()
-    {
-        return _logCookies;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve log cookies flag
+	 * 
+	 * @return value of the flag
+	 */
+	public boolean getLogCookies()
+	{
+		return _logCookies;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Controls logging of the request hostname.
-     * 
-     * @param logServer true - request hostname will be logged,
-     *                  false - request hostname will not be logged
-     */
-    public void setLogServer(boolean logServer)
-    {
-        _logServer = logServer;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Controls logging of the request hostname.
+	 * 
+	 * @param logServer true - request hostname will be logged,
+	 *                  false - request hostname will not be logged
+	 */
+	public void setLogServer(boolean logServer)
+	{
+		_logServer = logServer;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve log hostname flag.
-     * 
-     * @return value of the flag
-     */
-    public boolean getLogServer()
-    {
-        return _logServer;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve log hostname flag.
+	 * 
+	 * @return value of the flag
+	 */
+	public boolean getLogServer()
+	{
+		return _logServer;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Controls logging of request processing time.
-     * 
-     * @param logLatency true - request processing time will be logged
-     *                   false - request processing time will not be logged
-     */
-    public void setLogLatency(boolean logLatency)
-    {
-        _logLatency = logLatency;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Controls logging of request processing time.
+	 * 
+	 * @param logLatency true - request processing time will be logged
+	 *                   false - request processing time will not be logged
+	 */
+	public void setLogLatency(boolean logLatency)
+	{
+		_logLatency = logLatency;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve log request processing time flag.
-     * 
-     * @return value of the flag
-     */
-    public boolean getLogLatency()
-    {
-        return _logLatency;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve log request processing time flag.
+	 * 
+	 * @return value of the flag
+	 */
+	public boolean getLogLatency()
+	{
+		return _logLatency;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Controls whether the actual IP address of the connection or
-     * the IP address from the X-Forwarded-For header will be logged.
-     * 
-     * @param preferProxiedForAddress true - IP address from header will be logged,
-     *                                false - IP address from the connection will be logged
-     */
-    public void setPreferProxiedForAddress(boolean preferProxiedForAddress)
-    {
-        _preferProxiedForAddress = preferProxiedForAddress;
-    }
-    
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieved log X-Forwarded-For IP address flag.
-     * 
-     * @return value of the flag
-     */
-    public boolean getPreferProxiedForAddress()
-    {
-        return _preferProxiedForAddress;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Controls whether the actual IP address of the connection or
+	 * the IP address from the X-Forwarded-For header will be logged.
+	 * 
+	 * @param preferProxiedForAddress true - IP address from header will be logged,
+	 *                                false - IP address from the connection will be logged
+	 */
+	public void setPreferProxiedForAddress(boolean preferProxiedForAddress)
+	{
+		_preferProxiedForAddress = preferProxiedForAddress;
+	}
+	
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieved log X-Forwarded-For IP address flag.
+	 * 
+	 * @return value of the flag
+	 */
+	public boolean getPreferProxiedForAddress()
+	{
+		return _preferProxiedForAddress;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set the log file name date format.
-     * @see RolloverFileOutputStream#RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)
-     * 
-     * @param logFileDateFormat format string that is passed to {@link RolloverFileOutputStream}
-     */
-    public void setFilenameDateFormat(String logFileDateFormat)
-    {
-        _filenameDateFormat = logFileDateFormat;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set the log file name date format.
+	 * @see RolloverFileOutputStream#RolloverFileOutputStream(String, boolean, int, TimeZone, String, String)
+	 * 
+	 * @param logFileDateFormat format string that is passed to {@link RolloverFileOutputStream}
+	 */
+	public void setFilenameDateFormat(String logFileDateFormat)
+	{
+		_filenameDateFormat = logFileDateFormat;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve the file name date format string.
-     * 
-     * @return the log File Date Format
-     */
-    public String getFilenameDateFormat()
-    {
-        return _filenameDateFormat;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve the file name date format string.
+	 * 
+	 * @return the log File Date Format
+	 */
+	public String getFilenameDateFormat()
+	{
+		return _filenameDateFormat;
+	}
 
-    /* ------------------------------------------------------------ */
-    /** 
-     * Controls logging of the request dispatch time
-     * 
-     * @param value true - request dispatch time will be logged
-     *              false - request dispatch time will not be logged
-     */
-    public void setLogDispatch(boolean value)
-    {
-        _logDispatch = value;
-    }
+	/* ------------------------------------------------------------ */
+	/** 
+	 * Controls logging of the request dispatch time
+	 * 
+	 * @param value true - request dispatch time will be logged
+	 *              false - request dispatch time will not be logged
+	 */
+	public void setLogDispatch(boolean value)
+	{
+		_logDispatch = value;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Retrieve request dispatch time logging flag
-     * 
-     * @return value of the flag
-     */
-    public boolean isLogDispatch()
-    {
-        return _logDispatch;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Retrieve request dispatch time logging flag
+	 * 
+	 * @return value of the flag
+	 */
+	public boolean isLogDispatch()
+	{
+		return _logDispatch;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Writes the request and response information to the output stream.
-     * 
-     * @see org.eclipse.jetty.server.RequestLog#log(org.eclipse.jetty.server.Request, org.eclipse.jetty.server.Response)
-     */
-    public void log(Request request, Response response)
-    {
-        try
-        {
-            if (_ignorePathMap != null && _ignorePathMap.getMatch(request.getRequestURI()) != null)
-                return;
+	/* ------------------------------------------------------------ */
+	/**
+	 * Writes the request and response information to the output stream.
+	 * 
+	 * @see org.eclipse.jetty.server.RequestLog#log(org.eclipse.jetty.server.Request, org.eclipse.jetty.server.Response)
+	 */
+	public void log(Request request, Response response)
+	{
+		try
+		{
+			if (_ignorePathMap != null && _ignorePathMap.getMatch(request.getRequestURI()) != null)
+				return;
 
-            if (_fileOut == null)
-                return;
+			if (_fileOut == null)
+				return;
 
-            StringBuilder buf= _buffers.get();
-            buf.setLength(0);
+			StringBuilder buf= _buffers.get();
+			buf.setLength(0);
 
-            if (_logServer)
-            {
-                buf.append(request.getServerName());
-                buf.append(' ');
-            }
+			if (_logServer)
+			{
+				buf.append(request.getServerName());
+				buf.append(' ');
+			}
+
+			String addr = null;
+			if (_preferProxiedForAddress)
+			{
+				addr = request.getHeader(HttpHeaders.X_FORWARDED_FOR);
+			}
 
-            String addr = null;
-            if (_preferProxiedForAddress)
-            {
-                addr = request.getHeader(HttpHeaders.X_FORWARDED_FOR);
-            }
+			if (addr == null)
+				addr = request.getRemoteAddr();
 
-            if (addr == null)
-                addr = request.getRemoteAddr();
+			buf.append(addr);
+			buf.append(" - ");
+			Authentication authentication=request.getAuthentication();
+			buf.append(" - ");
 
-            buf.append(addr);
-            buf.append(" - ");
-            Authentication authentication=request.getAuthentication();
-            if (authentication instanceof Authentication.User)
-                buf.append(((Authentication.User)authentication).getUserIdentity().getUserPrincipal().getName());
-            else
-                buf.append(" - ");
+			buf.append(" [");
+			if (_logDateCache != null)
+				buf.append(_logDateCache.format(request.getTimeStamp()));
+			else
+				buf.append(request.getTimeStampBuffer().toString());
 
-            buf.append(" [");
-            if (_logDateCache != null)
-                buf.append(_logDateCache.format(request.getTimeStamp()));
-            else
-                buf.append(request.getTimeStampBuffer().toString());
-
-            buf.append("] \"");
-            buf.append(request.getMethod());
-            buf.append(' ');
-            buf.append(request.getUri().toString());
-            buf.append(' ');
-            buf.append(request.getProtocol());
-            buf.append("\" ");
-            if (request.getAsyncContinuation().isInitial())
-            {
-                int status = response.getStatus();
-                if (status <= 0)
-                    status = 404;
-                buf.append((char)('0' + ((status / 100) % 10)));
-                buf.append((char)('0' + ((status / 10) % 10)));
-                buf.append((char)('0' + (status % 10)));
-            }
-            else
-                buf.append("Async");
+			buf.append("] \"");
+			buf.append(request.getMethod());
+			buf.append(' ');
+			buf.append(request.getUri().toString());
+			buf.append(' ');
+			buf.append(request.getProtocol());
+			buf.append("\" ");
+			if (request.getAsyncContinuation().isInitial())
+			{
+				int status = response.getStatus();
+				if (status <= 0)
+					status = 404;
+				buf.append((char)('0' + ((status / 100) % 10)));
+				buf.append((char)('0' + ((status / 10) % 10)));
+				buf.append((char)('0' + (status % 10)));
+			}
+			else
+				buf.append("Async");
 
-            long responseLength = response.getContentCount();
-            if (responseLength >= 0)
-            {
-                buf.append(' ');
-                if (responseLength > 99999)
-                    buf.append(responseLength);
-                else
-                {
-                    if (responseLength > 9999)
-                        buf.append((char)('0' + ((responseLength / 10000) % 10)));
-                    if (responseLength > 999)
-                        buf.append((char)('0' + ((responseLength / 1000) % 10)));
-                    if (responseLength > 99)
-                        buf.append((char)('0' + ((responseLength / 100) % 10)));
-                    if (responseLength > 9)
-                        buf.append((char)('0' + ((responseLength / 10) % 10)));
-                    buf.append((char)('0' + (responseLength) % 10));
-                }
-                buf.append(' ');
-            }
-            else
-                buf.append(" - ");
+			long responseLength = response.getContentCount();
+			if (responseLength >= 0)
+			{
+				buf.append(' ');
+				if (responseLength > 99999)
+					buf.append(responseLength);
+				else
+				{
+					if (responseLength > 9999)
+						buf.append((char)('0' + ((responseLength / 10000) % 10)));
+					if (responseLength > 999)
+						buf.append((char)('0' + ((responseLength / 1000) % 10)));
+					if (responseLength > 99)
+						buf.append((char)('0' + ((responseLength / 100) % 10)));
+					if (responseLength > 9)
+						buf.append((char)('0' + ((responseLength / 10) % 10)));
+					buf.append((char)('0' + (responseLength) % 10));
+				}
+				buf.append(' ');
+			}
+			else
+				buf.append(" - ");
 
-            
-            if (_extended)
-                logExtended(request, response, buf);
+			
+			if (_extended)
+				logExtended(request, response, buf);
 
-            if (_logCookies)
-            {
-                Cookie[] cookies = request.getCookies();
-                if (cookies == null || cookies.length == 0)
-                    buf.append(" -");
-                else
-                {
-                    buf.append(" \"");
-                    for (int i = 0; i < cookies.length; i++)
-                    {
-                        if (i != 0)
-                            buf.append(';');
-                        buf.append(cookies[i].getName());
-                        buf.append('=');
-                        buf.append(cookies[i].getValue());
-                    }
-                    buf.append('\"');
-                }
-            }
+			if (_logCookies)
+			{
+				Cookie[] cookies = request.getCookies();
+				if (cookies == null || cookies.length == 0)
+					buf.append(" -");
+				else
+				{
+					buf.append(" \"");
+					for (int i = 0; i < cookies.length; i++)
+					{
+						if (i != 0)
+							buf.append(';');
+						buf.append(cookies[i].getName());
+						buf.append('=');
+						buf.append(cookies[i].getValue());
+					}
+					buf.append('\"');
+				}
+			}
 
-            if (_logDispatch || _logLatency)
-            {
-                long now = System.currentTimeMillis();
+			if (_logDispatch || _logLatency)
+			{
+				long now = System.currentTimeMillis();
 
-                if (_logDispatch)
-                {   
-                    long d = request.getDispatchTime();
-                    buf.append(' ');
-                    buf.append(now - (d==0 ? request.getTimeStamp():d));
-                }
+				if (_logDispatch)
+				{   
+					long d = request.getDispatchTime();
+					buf.append(' ');
+					buf.append(now - (d==0 ? request.getTimeStamp():d));
+				}
 
-                if (_logLatency)
-                {
-                    buf.append(' ');
-                    buf.append(now - request.getTimeStamp());
-                }
-            }
+				if (_logLatency)
+				{
+					buf.append(' ');
+					buf.append(now - request.getTimeStamp());
+				}
+			}
 
-            buf.append(StringUtil.__LINE_SEPARATOR);
-            
-            String log = buf.toString();
-            write(log);
-        }
-        catch (IOException e)
-        {
-            LOG.warn(e);
-        }
-    }
+			buf.append(StringUtil.__LINE_SEPARATOR);
+			
+			String log = buf.toString();
+			write(log);
+		}
+		catch (IOException e)
+		{
+			LOG.warn(e);
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    protected void write(String log) throws IOException 
-    {
-        synchronized(this)
-        {
-            if (_writer==null)
-                return;
-            _writer.write(log);
-            _writer.flush();
-        }
-    }
+	/* ------------------------------------------------------------ */
+	protected void write(String log) throws IOException 
+	{
+		synchronized(this)
+		{
+			if (_writer==null)
+				return;
+			_writer.write(log);
+			_writer.flush();
+		}
+	}
 
-    
-    /* ------------------------------------------------------------ */
-    /**
-     * Writes extended request and response information to the output stream.
-     * 
-     * @param request request object
-     * @param response response object
-     * @param b StringBuilder to write to
-     * @throws IOException
-     */
-    protected void logExtended(Request request,
-                               Response response,
-                               StringBuilder b) throws IOException
-    {
-        String referer = request.getHeader(HttpHeaders.REFERER);
-        if (referer == null)
-            b.append("\"-\" ");
-        else
-        {
-            b.append('"');
-            b.append(referer);
-            b.append("\" ");
-        }
+	
+	/* ------------------------------------------------------------ */
+	/**
+	 * Writes extended request and response information to the output stream.
+	 * 
+	 * @param request request object
+	 * @param response response object
+	 * @param b StringBuilder to write to
+	 * @throws IOException
+	 */
+	protected void logExtended(Request request,
+							   Response response,
+							   StringBuilder b) throws IOException
+	{
+		String referer = request.getHeader(HttpHeaders.REFERER);
+		if (referer == null)
+			b.append("\"-\" ");
+		else
+		{
+			b.append('"');
+			b.append(referer);
+			b.append("\" ");
+		}
 
-        String agent = request.getHeader(HttpHeaders.USER_AGENT);
-        if (agent == null)
-            b.append("\"-\" ");
-        else
-        {
-            b.append('"');
-            b.append(agent);
-            b.append('"');
-        }
-    }
+		String agent = request.getHeader(HttpHeaders.USER_AGENT);
+		if (agent == null)
+			b.append("\"-\" ");
+		else
+		{
+			b.append('"');
+			b.append(agent);
+			b.append('"');
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Set up request logging and open log file.
-     * 
-     * @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStart()
-     */
-    @Override
-    protected synchronized void doStart() throws Exception
-    {
-        if (_logDateFormat != null)
-        {
-            _logDateCache = new DateCache(_logDateFormat,_logLocale);
-            _logDateCache.setTimeZoneID(_logTimeZone);
-        }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Set up request logging and open log file.
+	 * 
+	 * @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStart()
+	 */
+	@Override
+	protected synchronized void doStart() throws Exception
+	{
+		if (_logDateFormat != null)
+		{
+			_logDateCache = new DateCache(_logDateFormat,_logLocale);
+			_logDateCache.setTimeZoneID(_logTimeZone);
+		}
 
-        if (_filename != null)
-        {
-            _fileOut = new RolloverFileOutputStream(_filename,_append,_retainDays,TimeZone.getTimeZone(_logTimeZone),_filenameDateFormat,null);
-            _closeOut = true;
-            LOG.info("Opened " + getDatedFilename());
-        }
-        else
-            _fileOut = System.err;
+		if (_filename != null)
+		{
+			_fileOut = new RolloverFileOutputStream(_filename,_append,_retainDays,TimeZone.getTimeZone(_logTimeZone),_filenameDateFormat,null);
+			_closeOut = true;
+			LOG.info("Opened " + getDatedFilename());
+		}
+		else
+			_fileOut = System.err;
 
-        _out = _fileOut;
+		_out = _fileOut;
 
-        if (_ignorePaths != null && _ignorePaths.length > 0)
-        {
-            _ignorePathMap = new PathMap();
-            for (int i = 0; i < _ignorePaths.length; i++)
-                _ignorePathMap.put(_ignorePaths[i],_ignorePaths[i]);
-        }
-        else
-            _ignorePathMap = null;
+		if (_ignorePaths != null && _ignorePaths.length > 0)
+		{
+			_ignorePathMap = new PathMap();
+			for (int i = 0; i < _ignorePaths.length; i++)
+				_ignorePathMap.put(_ignorePaths[i],_ignorePaths[i]);
+		}
+		else
+			_ignorePathMap = null;
 
-        synchronized(this)
-        {
-            _writer = new OutputStreamWriter(_out);
-        }
-        super.doStart();
-    }
+		synchronized(this)
+		{
+			_writer = new OutputStreamWriter(_out);
+		}
+		super.doStart();
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * Close the log file and perform cleanup.
-     * 
-     * @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStop()
-     */
-    @Override
-    protected void doStop() throws Exception
-    {
-        synchronized (this)
-        {
-            super.doStop();
-            try
-            {
-                if (_writer != null)
-                    _writer.flush();
-            }
-            catch (IOException e)
-            {
-                LOG.ignore(e);
-            }
-            if (_out != null && _closeOut)
-                try
-                {
-                    _out.close();
-                }
-                catch (IOException e)
-                {
-                    LOG.ignore(e);
-                }
+	/* ------------------------------------------------------------ */
+	/**
+	 * Close the log file and perform cleanup.
+	 * 
+	 * @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStop()
+	 */
+	@Override
+	protected void doStop() throws Exception
+	{
+		synchronized (this)
+		{
+			super.doStop();
+			try
+			{
+				if (_writer != null)
+					_writer.flush();
+			}
+			catch (IOException e)
+			{
+				LOG.ignore(e);
+			}
+			if (_out != null && _closeOut)
+				try
+				{
+					_out.close();
+				}
+				catch (IOException e)
+				{
+					LOG.ignore(e);
+				}
 
-            _out = null;
-            _fileOut = null;
-            _closeOut = false;
-            _logDateCache = null;
-            _writer = null;
-        }
-    }
+			_out = null;
+			_fileOut = null;
+			_closeOut = false;
+			_logDateCache = null;
+			_writer = null;
+		}
+	}
 }
--- a/src/org/eclipse/jetty/server/Request.java	Thu Sep 08 21:44:37 2016 -0600
+++ b/src/org/eclipse/jetty/server/Request.java	Thu Sep 08 22:01:33 2016 -0600
@@ -209,7 +209,6 @@
 	private Object _requestAttributeListeners;
 	private String _requestURI;
 	private String _scheme = URIUtil.HTTP;
-	private UserIdentity.Scope _scope;
 	private String _serverName;
 	private String _servletPath;
 	private long _timeStamp;
@@ -1206,16 +1205,6 @@
 
 	/* ------------------------------------------------------------ */
 	/*
-	 */
-	public String getServletName()
-	{
-		if (_scope != null)
-			return _scope.getName();
-		return null;
-	}
-
-	/* ------------------------------------------------------------ */
-	/*
 	 * @see javax.servlet.http.HttpServletRequest#getServletPath()
 	 */
 	public String getServletPath()
@@ -1283,35 +1272,6 @@
 	}
 
 	/* ------------------------------------------------------------ */
-	public UserIdentity getUserIdentity()
-	{
-		if (_authentication instanceof Authentication.Deferred)
-			setAuthentication(((Authentication.Deferred)_authentication).authenticate(this));
-
-		if (_authentication instanceof Authentication.User)
-			return ((Authentication.User)_authentication).getUserIdentity();
-		return null;
-	}
-
-	/* ------------------------------------------------------------ */
-	/**
-	 * @return The resolved user Identity, which may be null if the {@link Authentication} is not {@link Authentication.User} (eg.
-	 *         {@link Authentication.Deferred}).
-	 */
-	public UserIdentity getResolvedUserIdentity()
-	{
-		if (_authentication instanceof Authentication.User)
-			return ((Authentication.User)_authentication).getUserIdentity();
-		return null;
-	}
-
-	/* ------------------------------------------------------------ */
-	public UserIdentity.Scope getUserIdentityScope()
-	{
-		return _scope;
-	}
-
-	/* ------------------------------------------------------------ */
 	/*
 	 * @see javax.servlet.http.HttpServletRequest#getUserPrincipal()
 	 */
@@ -1320,12 +1280,6 @@
 		if (_authentication instanceof Authentication.Deferred)
 			setAuthentication(((Authentication.Deferred)_authentication).authenticate(this));
 
-		if (_authentication instanceof Authentication.User)
-		{
-			UserIdentity user = ((Authentication.User)_authentication).getUserIdentity();
-			return user.getUserPrincipal();
-		}
-		
 		return null;
 	}
 
@@ -1411,9 +1365,6 @@
 	{
 		if (_authentication instanceof Authentication.Deferred)
 			setAuthentication(((Authentication.Deferred)_authentication).authenticate(this));
-
-		if (_authentication instanceof Authentication.User)
-			return ((Authentication.User)_authentication).isUserInRole(_scope,role);
 		return false;
 	}
 
@@ -1463,7 +1414,6 @@
 		_queryEncoding = null;
 		_queryString = null;
 		_requestURI = null;
-		_scope = null;
 		_scheme = URIUtil.HTTP;
 		_servletPath = null;
 		_timeStamp = 0;
@@ -1886,12 +1836,6 @@
 	}
 
 	/* ------------------------------------------------------------ */
-	public void setUserIdentityScope(UserIdentity.Scope scope)
-	{
-		_scope = scope;
-	}
-
-	/* ------------------------------------------------------------ */
 	/**
 	 * Set timetstamp of request dispatch
 	 *
--- a/src/org/eclipse/jetty/server/Response.java	Thu Sep 08 21:44:37 2016 -0600
+++ b/src/org/eclipse/jetty/server/Response.java	Thu Sep 08 22:01:33 2016 -0600
@@ -61,1158 +61,1157 @@
  */
 public class Response implements HttpServletResponse
 {
-    private static final Logger LOG = Log.getLogger(Response.class);
+	private static final Logger LOG = Log.getLogger(Response.class);
 
-    
-    public static final int
-        NONE=0,
-        STREAM=1,
-        WRITER=2;
+	
+	public static final int
+		NONE=0,
+		STREAM=1,
+		WRITER=2;
 
-    /**
-     * If a header name starts with this string,  the header (stripped of the prefix)
-     * can be set during include using only {@link #setHeader(String, String)} or
-     * {@link #addHeader(String, String)}.
-     */
-    public final static String SET_INCLUDE_HEADER_PREFIX = "org.eclipse.jetty.server.include.";
+	/**
+	 * If a header name starts with this string,  the header (stripped of the prefix)
+	 * can be set during include using only {@link #setHeader(String, String)} or
+	 * {@link #addHeader(String, String)}.
+	 */
+	public final static String SET_INCLUDE_HEADER_PREFIX = "org.eclipse.jetty.server.include.";
 
-    /**
-     * If this string is found within the comment of a cookie added with {@link #addCookie(Cookie)}, then the cookie 
-     * will be set as HTTP ONLY.
-     */
-    public final static String HTTP_ONLY_COMMENT="__HTTP_ONLY__";
-    
-    
-    /* ------------------------------------------------------------ */
-    public static Response getResponse(HttpServletResponse response)
-    {
-        if (response instanceof Response)
-            return (Response)response;
+	/**
+	 * If this string is found within the comment of a cookie added with {@link #addCookie(Cookie)}, then the cookie 
+	 * will be set as HTTP ONLY.
+	 */
+	public final static String HTTP_ONLY_COMMENT="__HTTP_ONLY__";
+	
+	
+	/* ------------------------------------------------------------ */
+	public static Response getResponse(HttpServletResponse response)
+	{
+		if (response instanceof Response)
+			return (Response)response;
 
-        return AbstractHttpConnection.getCurrentConnection().getResponse();
-    }
-    
-    private final AbstractHttpConnection _connection;
-    private int _status=SC_OK;
-    private String _reason;
-    private Locale _locale;
-    private String _mimeType;
-    private CachedBuffer _cachedMimeType;
-    private String _characterEncoding;
-    private boolean _explicitEncoding;
-    private String _contentType;
-    private volatile int _outputState;
-    private PrintWriter _writer;
+		return AbstractHttpConnection.getCurrentConnection().getResponse();
+	}
+	
+	private final AbstractHttpConnection _connection;
+	private int _status=SC_OK;
+	private String _reason;
+	private Locale _locale;
+	private String _mimeType;
+	private CachedBuffer _cachedMimeType;
+	private String _characterEncoding;
+	private boolean _explicitEncoding;
+	private String _contentType;
+	private volatile int _outputState;
+	private PrintWriter _writer;
 
-    /* ------------------------------------------------------------ */
-    /**
-     *
-     */
-    public Response(AbstractHttpConnection connection)
-    {
-        _connection=connection;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 *
+	 */
+	public Response(AbstractHttpConnection connection)
+	{
+		_connection=connection;
+	}
 
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#reset()
-     */
-    protected void recycle()
-    {
-        _status=SC_OK;
-        _reason=null;
-        _locale=null;
-        _mimeType=null;
-        _cachedMimeType=null;
-        _characterEncoding=null;
-        _explicitEncoding=false;
-        _contentType=null;
-        _writer=null;
-        _outputState=NONE;
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#reset()
+	 */
+	protected void recycle()
+	{
+		_status=SC_OK;
+		_reason=null;
+		_locale=null;
+		_mimeType=null;
+		_cachedMimeType=null;
+		_characterEncoding=null;
+		_explicitEncoding=false;
+		_contentType=null;
+		_writer=null;
+		_outputState=NONE;
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#addCookie(javax.servlet.http.Cookie)
-     */
-    public void addCookie(HttpCookie cookie)
-    {
-        _connection.getResponseFields().addSetCookie(cookie);
-    }
-    
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#addCookie(javax.servlet.http.Cookie)
-     */
-    public void addCookie(Cookie cookie)
-    {
-        String comment=cookie.getComment();
-        boolean http_only=false;
-        
-        if (comment!=null)
-        {
-            int i=comment.indexOf(HTTP_ONLY_COMMENT);
-            if (i>=0)
-            {
-                http_only=true;
-                comment=comment.replace(HTTP_ONLY_COMMENT,"").trim();
-                if (comment.length()==0)
-                    comment=null;
-            }
-        }
-        _connection.getResponseFields().addSetCookie(cookie.getName(),
-                cookie.getValue(),
-                cookie.getDomain(),
-                cookie.getPath(),
-                cookie.getMaxAge(),
-                comment,
-                cookie.getSecure(),
-                http_only || cookie.isHttpOnly(),
-                cookie.getVersion());
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#addCookie(javax.servlet.http.Cookie)
+	 */
+	public void addCookie(HttpCookie cookie)
+	{
+		_connection.getResponseFields().addSetCookie(cookie);
+	}
+	
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#addCookie(javax.servlet.http.Cookie)
+	 */
+	public void addCookie(Cookie cookie)
+	{
+		String comment=cookie.getComment();
+		boolean http_only=false;
+		
+		if (comment!=null)
+		{
+			int i=comment.indexOf(HTTP_ONLY_COMMENT);
+			if (i>=0)
+			{
+				http_only=true;
+				comment=comment.replace(HTTP_ONLY_COMMENT,"").trim();
+				if (comment.length()==0)
+					comment=null;
+			}
+		}
+		_connection.getResponseFields().addSetCookie(cookie.getName(),
+				cookie.getValue(),
+				cookie.getDomain(),
+				cookie.getPath(),
+				cookie.getMaxAge(),
+				comment,
+				cookie.getSecure(),
+				http_only || cookie.isHttpOnly(),
+				cookie.getVersion());
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#containsHeader(java.lang.String)
-     */
-    public boolean containsHeader(String name)
-    {
-        return _connection.getResponseFields().containsKey(name);
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#containsHeader(java.lang.String)
+	 */
+	public boolean containsHeader(String name)
+	{
+		return _connection.getResponseFields().containsKey(name);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#encodeURL(java.lang.String)
-     */
-    public String encodeURL(String url)
-    {
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#encodeURL(java.lang.String)
+	 */
+	public String encodeURL(String url)
+	{
 		throw new UnsupportedOperationException();
-    }
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * @see javax.servlet.http.HttpServletResponse#encodeRedirectURL(java.lang.String)
-     */
-    public String encodeRedirectURL(String url)
-    {
-        return encodeURL(url);
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * @see javax.servlet.http.HttpServletResponse#encodeRedirectURL(java.lang.String)
+	 */
+	public String encodeRedirectURL(String url)
+	{
+		return encodeURL(url);
+	}
 
-    /* ------------------------------------------------------------ */
-    @Deprecated
-    public String encodeUrl(String url)
-    {
-        return encodeURL(url);
-    }
+	/* ------------------------------------------------------------ */
+	@Deprecated
+	public String encodeUrl(String url)
+	{
+		return encodeURL(url);
+	}
 
-    /* ------------------------------------------------------------ */
-    @Deprecated
-    public String encodeRedirectUrl(String url)
-    {
-        return encodeRedirectURL(url);
-    }
+	/* ------------------------------------------------------------ */
+	@Deprecated
+	public String encodeRedirectUrl(String url)
+	{
+		return encodeRedirectURL(url);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#sendError(int, java.lang.String)
-     */
-    public void sendError(int code, String message) throws IOException
-    {
-    	if (_connection.isIncluding())
-    		return;
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#sendError(int, java.lang.String)
+	 */
+	public void sendError(int code, String message) throws IOException
+	{
+		if (_connection.isIncluding())
+			return;
 
-        if (isCommitted())
-            LOG.warn("Committed before "+code+" "+message);
+		if (isCommitted())
+			LOG.warn("Committed before "+code+" "+message);
 
-        resetBuffer();
-        _characterEncoding=null;
-        setHeader(HttpHeaders.EXPIRES,null);
-        setHeader(HttpHeaders.LAST_MODIFIED,null);
-        setHeader(HttpHeaders.CACHE_CONTROL,null);
-        setHeader(HttpHeaders.CONTENT_TYPE,null);
-        setHeader(HttpHeaders.CONTENT_LENGTH,null);
+		resetBuffer();
+		_characterEncoding=null;
+		setHeader(HttpHeaders.EXPIRES,null);
+		setHeader(HttpHeaders.LAST_MODIFIED,null);
+		setHeader(HttpHeaders.CACHE_CONTROL,null);
+		setHeader(HttpHeaders.CONTENT_TYPE,null);
+		setHeader(HttpHeaders.CONTENT_LENGTH,null);
 
-        _outputState=NONE;
-        setStatus(code,message);
+		_outputState=NONE;
+		setStatus(code,message);
 
-        if (message==null)
-            message=HttpStatus.getMessage(code);
+		if (message==null)
+			message=HttpStatus.getMessage(code);
 
-        // If we are allowed to have a body
-        if (code!=SC_NO_CONTENT &&
-            code!=SC_NOT_MODIFIED &&
-            code!=SC_PARTIAL_CONTENT &&
-            code>=SC_OK)
-        {
-            Request request = _connection.getRequest();
+		// If we are allowed to have a body
+		if (code!=SC_NO_CONTENT &&
+			code!=SC_NOT_MODIFIED &&
+			code!=SC_PARTIAL_CONTENT &&
+			code>=SC_OK)
+		{
+			Request request = _connection.getRequest();
 
-            ErrorHandler error_handler = null;
-            ContextHandler.Context context = request.getContext();
-            if (context!=null)
-                error_handler=context.getContextHandler().getErrorHandler();
-            if (error_handler==null)
-                error_handler = _connection.getConnector().getServer().getBean(ErrorHandler.class);
-            if (error_handler!=null)
-            {
-                request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,new Integer(code));
-                request.setAttribute(RequestDispatcher.ERROR_MESSAGE, message);
-                request.setAttribute(RequestDispatcher.ERROR_REQUEST_URI, request.getRequestURI());
-                request.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,request.getServletName());
-                error_handler.handle(null,_connection.getRequest(),_connection.getRequest(),this );
-            }
-            else
-            {
-                setHeader(HttpHeaders.CACHE_CONTROL, "must-revalidate,no-cache,no-store");
-                setContentType(MimeTypes.TEXT_HTML_8859_1);
-                ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(2048);
-                if (message != null)
-                {
-                    message= StringUtil.replace(message, "&", "&amp;");
-                    message= StringUtil.replace(message, "<", "&lt;");
-                    message= StringUtil.replace(message, ">", "&gt;");
-                }
-                String uri= request.getRequestURI();
-                if (uri!=null)
-                {
-                    uri= StringUtil.replace(uri, "&", "&amp;");
-                    uri= StringUtil.replace(uri, "<", "&lt;");
-                    uri= StringUtil.replace(uri, ">", "&gt;");
-                }
+			ErrorHandler error_handler = null;
+			ContextHandler.Context context = request.getContext();
+			if (context!=null)
+				error_handler=context.getContextHandler().getErrorHandler();
+			if (error_handler==null)
+				error_handler = _connection.getConnector().getServer().getBean(ErrorHandler.class);
+			if (error_handler!=null)
+			{
+				request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,new Integer(code));
+				request.setAttribute(RequestDispatcher.ERROR_MESSAGE, message);
+				request.setAttribute(RequestDispatcher.ERROR_REQUEST_URI, request.getRequestURI());
+				error_handler.handle(null,_connection.getRequest(),_connection.getRequest(),this );
+			}
+			else
+			{
+				setHeader(HttpHeaders.CACHE_CONTROL, "must-revalidate,no-cache,no-store");
+				setContentType(MimeTypes.TEXT_HTML_8859_1);
+				ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(2048);
+				if (message != null)
+				{
+					message= StringUtil.replace(message, "&", "&amp;");
+					message= StringUtil.replace(message, "<", "&lt;");
+					message= StringUtil.replace(message, ">", "&gt;");
+				}
+				String uri= request.getRequestURI();
+				if (uri!=null)
+				{
+					uri= StringUtil.replace(uri, "&", "&amp;");
+					uri= StringUtil.replace(uri, "<", "&lt;");
+					uri= StringUtil.replace(uri, ">", "&gt;");
+				}
 
-                writer.write("<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=ISO-8859-1\"/>\n");
-                writer.write("<title>Error ");
-                writer.write(Integer.toString(code));
-                writer.write(' ');
-                if (message==null)
-                    message=HttpStatus.getMessage(code);
-                writer.write(message);
-                writer.write("</title>\n</head>\n<body>\n<h2>HTTP ERROR: ");
-                writer.write(Integer.toString(code));
-                writer.write("</h2>\n<p>Problem accessing ");
-                writer.write(uri);
-                writer.write(". Reason:\n<pre>    ");
-                writer.write(message);
-                writer.write("</pre>");
-                writer.write("</p>\n<hr /><i><small>Powered by Jetty://</small></i>");
+				writer.write("<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=ISO-8859-1\"/>\n");
+				writer.write("<title>Error ");
+				writer.write(Integer.toString(code));
+				writer.write(' ');
+				if (message==null)
+					message=HttpStatus.getMessage(code);
+				writer.write(message);
+				writer.write("</title>\n</head>\n<body>\n<h2>HTTP ERROR: ");
+				writer.write(Integer.toString(code));
+				writer.write("</h2>\n<p>Problem accessing ");
+				writer.write(uri);
+				writer.write(". Reason:\n<pre>    ");
+				writer.write(message);
+				writer.write("</pre>");
+				writer.write("</p>\n<hr /><i><small>Powered by Jetty://</small></i>");
 
-                for (int i= 0; i < 20; i++)
-                    writer.write("\n                                                ");
-                writer.write("\n</body>\n</html>\n");
+				for (int i= 0; i < 20; i++)
+					writer.write("\n                                                ");
+				writer.write("\n</body>\n</html>\n");
 
-                writer.flush();
-                setContentLength(writer.size());
-                writer.writeTo(getOutputStream());
-                writer.destroy();
-            }
-        }
-        else if (code!=SC_PARTIAL_CONTENT)
-        {
-            _connection.getRequestFields().remove(HttpHeaders.CONTENT_TYPE_BUFFER);
-            _connection.getRequestFields().remove(HttpHeaders.CONTENT_LENGTH_BUFFER);
-            _characterEncoding=null;
-            _mimeType=null;
-            _cachedMimeType=null;
-        }
+				writer.flush();
+				setContentLength(writer.size());
+				writer.writeTo(getOutputStream());
+				writer.destroy();
+			}
+		}
+		else if (code!=SC_PARTIAL_CONTENT)
+		{
+			_connection.getRequestFields().remove(HttpHeaders.CONTENT_TYPE_BUFFER);
+			_connection.getRequestFields().remove(HttpHeaders.CONTENT_LENGTH_BUFFER);
+			_characterEncoding=null;
+			_mimeType=null;
+			_cachedMimeType=null;
+		}
 
-        complete();
-    }
+		complete();
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#sendError(int)
-     */
-    public void sendError(int sc) throws IOException
-    {
-        if (sc==102)
-            sendProcessing();
-        else
-            sendError(sc,null);
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#sendError(int)
+	 */
+	public void sendError(int sc) throws IOException
+	{
+		if (sc==102)
+			sendProcessing();
+		else
+			sendError(sc,null);
+	}
 
-    /* ------------------------------------------------------------ */
-    /* Send a 102-Processing response.
-     * If the connection is a HTTP connection, the version is 1.1 and the
-     * request has a Expect header starting with 102, then a 102 response is
-     * sent. This indicates that the request still be processed and real response
-     * can still be sent.   This method is called by sendError if it is passed 102.
-     * @see javax.servlet.http.HttpServletResponse#sendError(int)
-     */
-    public void sendProcessing() throws IOException
-    {
-        if (_connection.isExpecting102Processing() && !isCommitted())
-            ((HttpGenerator)_connection.getGenerator()).send1xx(HttpStatus.PROCESSING_102);
-    }
+	/* ------------------------------------------------------------ */
+	/* Send a 102-Processing response.
+	 * If the connection is a HTTP connection, the version is 1.1 and the
+	 * request has a Expect header starting with 102, then a 102 response is
+	 * sent. This indicates that the request still be processed and real response
+	 * can still be sent.   This method is called by sendError if it is passed 102.
+	 * @see javax.servlet.http.HttpServletResponse#sendError(int)
+	 */
+	public void sendProcessing() throws IOException
+	{
+		if (_connection.isExpecting102Processing() && !isCommitted())
+			((HttpGenerator)_connection.getGenerator()).send1xx(HttpStatus.PROCESSING_102);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#sendRedirect(java.lang.String)
-     */
-    public void sendRedirect(String location) throws IOException
-    {
-    	if (_connection.isIncluding())
-    		return;
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#sendRedirect(java.lang.String)
+	 */
+	public void sendRedirect(String location) throws IOException
+	{
+		if (_connection.isIncluding())
+			return;
 
-        if (location==null)
-            throw new IllegalArgumentException();
+		if (location==null)
+			throw new IllegalArgumentException();
 
-        if (!URIUtil.hasScheme(location))
-        {
-            StringBuilder buf = _connection.getRequest().getRootURL();
-            if (location.startsWith("/"))
-                buf.append(location);
-            else
-            {
-                String path=_connection.getRequest().getRequestURI();
-                String parent=(path.endsWith("/"))?path:URIUtil.parentPath(path);
-                location=URIUtil.addPaths(parent,location);
-                if(location==null)
-                    throw new IllegalStateException("path cannot be above root");
-                if (!location.startsWith("/"))
-                    buf.append('/');
-                buf.append(location);
-            }
+		if (!URIUtil.hasScheme(location))
+		{
+			StringBuilder buf = _connection.getRequest().getRootURL();
+			if (location.startsWith("/"))
+				buf.append(location);
+			else
+			{
+				String path=_connection.getRequest().getRequestURI();
+				String parent=(path.endsWith("/"))?path:URIUtil.parentPath(path);
+				location=URIUtil.addPaths(parent,location);
+				if(location==null)
+					throw new IllegalStateException("path cannot be above root");
+				if (!location.startsWith("/"))
+					buf.append('/');
+				buf.append(location);
+			}
 
-            location=buf.toString();
-            HttpURI uri = new HttpURI(location);
-            String path=uri.getDecodedPath();
-            String canonical=URIUtil.canonicalPath(path);
-            if (canonical==null)
-                throw new IllegalArgumentException();
-            if (!canonical.equals(path))
-            {
-                buf = _connection.getRequest().getRootURL();
-                buf.append(URIUtil.encodePath(canonical));
-                String param=uri.getParam();
-                if (param!=null)
-                {
-                    buf.append(';');
-                    buf.append(param);
-                }
-                String query=uri.getQuery();
-                if (query!=null)
-                {
-                    buf.append('?');
-                    buf.append(query);
-                }
-                String fragment=uri.getFragment();
-                if (fragment!=null)
-                {
-                    buf.append('#');
-                    buf.append(fragment);
-                }
-                location=buf.toString();
-            }
-        }
-        
-        resetBuffer();
-        setHeader(HttpHeaders.LOCATION,location);
-        setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
-        complete();
+			location=buf.toString();
+			HttpURI uri = new HttpURI(location);
+			String path=uri.getDecodedPath();
+			String canonical=URIUtil.canonicalPath(path);
+			if (canonical==null)
+				throw new IllegalArgumentException();
+			if (!canonical.equals(path))
+			{
+				buf = _connection.getRequest().getRootURL();
+				buf.append(URIUtil.encodePath(canonical));
+				String param=uri.getParam();
+				if (param!=null)
+				{
+					buf.append(';');
+					buf.append(param);
+				}
+				String query=uri.getQuery();
+				if (query!=null)
+				{
+					buf.append('?');
+					buf.append(query);
+				}
+				String fragment=uri.getFragment();
+				if (fragment!=null)
+				{
+					buf.append('#');
+					buf.append(fragment);
+				}
+				location=buf.toString();
+			}
+		}
+		
+		resetBuffer();
+		setHeader(HttpHeaders.LOCATION,location);
+		setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
+		complete();
 
-    }
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#setDateHeader(java.lang.String, long)
-     */
-    public void setDateHeader(String name, long date)
-    {
-        if (!_connection.isIncluding())
-            _connection.getResponseFields().putDateField(name, date);
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#setDateHeader(java.lang.String, long)
+	 */
+	public void setDateHeader(String name, long date)
+	{
+		if (!_connection.isIncluding())
+			_connection.getResponseFields().putDateField(name, date);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#addDateHeader(java.lang.String, long)
-     */
-    public void addDateHeader(String name, long date)
-    {
-        if (!_connection.isIncluding())
-            _connection.getResponseFields().addDateField(name, date);
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#addDateHeader(java.lang.String, long)
+	 */
+	public void addDateHeader(String name, long date)
+	{
+		if (!_connection.isIncluding())
+			_connection.getResponseFields().addDateField(name, date);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#setHeader(java.lang.String, java.lang.String)
-     */
-    public void setHeader(String name, String value)
-    {
-        if (HttpHeaders.CONTENT_TYPE.equalsIgnoreCase(name))
-            setContentType(value);
-        else
-        {
-            if (_connection.isIncluding())
-            {
-                if (name.startsWith(SET_INCLUDE_HEADER_PREFIX))
-                    name=name.substring(SET_INCLUDE_HEADER_PREFIX.length());
-                else
-                    return;
-            }
-            _connection.getResponseFields().put(name, value);
-            if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name))
-            {
-                if (value==null)
-                    _connection._generator.setContentLength(-1);
-                else
-                    _connection._generator.setContentLength(Long.parseLong(value));
-            }
-        }
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#setHeader(java.lang.String, java.lang.String)
+	 */
+	public void setHeader(String name, String value)
+	{
+		if (HttpHeaders.CONTENT_TYPE.equalsIgnoreCase(name))
+			setContentType(value);
+		else
+		{
+			if (_connection.isIncluding())
+			{
+				if (name.startsWith(SET_INCLUDE_HEADER_PREFIX))
+					name=name.substring(SET_INCLUDE_HEADER_PREFIX.length());
+				else
+					return;
+			}
+			_connection.getResponseFields().put(name, value);
+			if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name))
+			{
+				if (value==null)
+					_connection._generator.setContentLength(-1);
+				else
+					_connection._generator.setContentLength(Long.parseLong(value));
+			}
+		}
+	}
 
 
-    /* ------------------------------------------------------------ */
-    public Collection<String> getHeaderNames()
-    {
-        final HttpFields fields=_connection.getResponseFields();
-        return fields.getFieldNamesCollection();
-    }
-    
-    /* ------------------------------------------------------------ */
-    /*
-     */
-    public String getHeader(String name)
-    {
-        return _connection.getResponseFields().getStringField(name);
-    }
+	/* ------------------------------------------------------------ */
+	public Collection<String> getHeaderNames()
+	{
+		final HttpFields fields=_connection.getResponseFields();
+		return fields.getFieldNamesCollection();
+	}
+	
+	/* ------------------------------------------------------------ */
+	/*
+	 */
+	public String getHeader(String name)
+	{
+		return _connection.getResponseFields().getStringField(name);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     */
-    public Collection<String> getHeaders(String name)
-    {
-        final HttpFields fields=_connection.getResponseFields();
-        Collection<String> i = fields.getValuesCollection(name);
-        if (i==null)
-            return Collections.EMPTY_LIST;
-        return i;
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 */
+	public Collection<String> getHeaders(String name)
+	{
+		final HttpFields fields=_connection.getResponseFields();
+		Collection<String> i = fields.getValuesCollection(name);
+		if (i==null)
+			return Collections.EMPTY_LIST;
+		return i;
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#addHeader(java.lang.String, java.lang.String)
-     */
-    public void addHeader(String name, String value)
-    {
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#addHeader(java.lang.String, java.lang.String)
+	 */
+	public void addHeader(String name, String value)
+	{
 
-        if (_connection.isIncluding())
-        {
-            if (name.startsWith(SET_INCLUDE_HEADER_PREFIX))
-                name=name.substring(SET_INCLUDE_HEADER_PREFIX.length());
-            else
-                return;
-        }
+		if (_connection.isIncluding())
+		{
+			if (name.startsWith(SET_INCLUDE_HEADER_PREFIX))
+				name=name.substring(SET_INCLUDE_HEADER_PREFIX.length());
+			else
+				return;
+		}
 
-        if (HttpHeaders.CONTENT_TYPE.equalsIgnoreCase(name))
-        {
-            setContentType(value);
-            return;
-        }
-        
-        _connection.getResponseFields().add(name, value);
-        if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name))
-            _connection._generator.setContentLength(Long.parseLong(value));
-    }
+		if (HttpHeaders.CONTENT_TYPE.equalsIgnoreCase(name))
+		{
+			setContentType(value);
+			return;
+		}
+		
+		_connection.getResponseFields().add(name, value);
+		if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name))
+			_connection._generator.setContentLength(Long.parseLong(value));
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#setIntHeader(java.lang.String, int)
-     */
-    public void setIntHeader(String name, int value)
-    {
-        if (!_connection.isIncluding())
-        {
-            _connection.getResponseFields().putLongField(name, value);
-            if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name))
-                _connection._generator.setContentLength(value);
-        }
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#setIntHeader(java.lang.String, int)
+	 */
+	public void setIntHeader(String name, int value)
+	{
+		if (!_connection.isIncluding())
+		{
+			_connection.getResponseFields().putLongField(name, value);
+			if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name))
+				_connection._generator.setContentLength(value);
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#addIntHeader(java.lang.String, int)
-     */
-    public void addIntHeader(String name, int value)
-    {
-        if (!_connection.isIncluding())
-        {
-            _connection.getResponseFields().addLongField(name, value);
-            if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name))
-                _connection._generator.setContentLength(value);
-        }
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#addIntHeader(java.lang.String, int)
+	 */
+	public void addIntHeader(String name, int value)
+	{
+		if (!_connection.isIncluding())
+		{
+			_connection.getResponseFields().addLongField(name, value);
+			if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name))
+				_connection._generator.setContentLength(value);
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#setStatus(int)
-     */
-    public void setStatus(int sc)
-    {
-        setStatus(sc,null);
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#setStatus(int)
+	 */
+	public void setStatus(int sc)
+	{
+		setStatus(sc,null);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.http.HttpServletResponse#setStatus(int, java.lang.String)
-     */
-    public void setStatus(int sc, String sm)
-    {
-        if (sc<=0)
-            throw new IllegalArgumentException();
-        if (!_connection.isIncluding())
-        {
-            _status=sc;
-            _reason=sm;
-        }
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.http.HttpServletResponse#setStatus(int, java.lang.String)
+	 */
+	public void setStatus(int sc, String sm)
+	{
+		if (sc<=0)
+			throw new IllegalArgumentException();
+		if (!_connection.isIncluding())
+		{
+			_status=sc;
+			_reason=sm;
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#getCharacterEncoding()
-     */
-    public String getCharacterEncoding()
-    {
-        if (_characterEncoding==null)
-            _characterEncoding=StringUtil.__ISO_8859_1;
-        return _characterEncoding;
-    }
-    
-    /* ------------------------------------------------------------ */
-    String getSetCharacterEncoding()
-    {
-        return _characterEncoding;
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#getCharacterEncoding()
+	 */
+	public String getCharacterEncoding()
+	{
+		if (_characterEncoding==null)
+			_characterEncoding=StringUtil.__ISO_8859_1;
+		return _characterEncoding;
+	}
+	
+	/* ------------------------------------------------------------ */
+	String getSetCharacterEncoding()
+	{
+		return _characterEncoding;
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#getContentType()
-     */
-    public String getContentType()
-    {
-        return _contentType;
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#getContentType()
+	 */
+	public String getContentType()
+	{
+		return _contentType;
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#getOutputStream()
-     */
-    public ServletOutputStream getOutputStream() throws IOException
-    {
-        if (_outputState!=NONE && _outputState!=STREAM)
-            throw new IllegalStateException("WRITER");
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#getOutputStream()
+	 */
+	public ServletOutputStream getOutputStream() throws IOException
+	{
+		if (_outputState!=NONE && _outputState!=STREAM)
+			throw new IllegalStateException("WRITER");
 
-        ServletOutputStream out = _connection.getOutputStream();
-        _outputState=STREAM;
-        return out;
-    }
+		ServletOutputStream out = _connection.getOutputStream();
+		_outputState=STREAM;
+		return out;
+	}
 
-    /* ------------------------------------------------------------ */
-    public boolean isWriting()
-    {
-        return _outputState==WRITER;
-    }
+	/* ------------------------------------------------------------ */
+	public boolean isWriting()
+	{
+		return _outputState==WRITER;
+	}
 
-    /* ------------------------------------------------------------ */
-    public boolean isOutputing()
-    {
-        return _outputState!=NONE;
-    }
+	/* ------------------------------------------------------------ */
+	public boolean isOutputing()
+	{
+		return _outputState!=NONE;
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#getWriter()
-     */
-    public PrintWriter getWriter() throws IOException
-    {
-        if (_outputState!=NONE && _outputState!=WRITER)
-            throw new IllegalStateException("STREAM");
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#getWriter()
+	 */
+	public PrintWriter getWriter() throws IOException
+	{
+		if (_outputState!=NONE && _outputState!=WRITER)
+			throw new IllegalStateException("STREAM");
 
-        /* if there is no writer yet */
-        if (_writer==null)
-        {
-            /* get encoding from Content-Type header */
-            String encoding = _characterEncoding;
+		/* if there is no writer yet */
+		if (_writer==null)
+		{
+			/* get encoding from Content-Type header */
+			String encoding = _characterEncoding;
 
-            if (encoding==null)
-            {
-                /* implementation of educated defaults */
-                if(_cachedMimeType != null)
-                    encoding = MimeTypes.getCharsetFromContentType(_cachedMimeType);
+			if (encoding==null)
+			{
+				/* implementation of educated defaults */
+				if(_cachedMimeType != null)
+					encoding = MimeTypes.getCharsetFromContentType(_cachedMimeType);
 
-                if (encoding==null)
-                    encoding = StringUtil.__ISO_8859_1;
+				if (encoding==null)
+					encoding = StringUtil.__ISO_8859_1;
 
-                setCharacterEncoding(encoding);
-            }
+				setCharacterEncoding(encoding);
+			}
 
-            /* construct Writer using correct encoding */
-            _writer = _connection.getPrintWriter(encoding);
-        }
-        _outputState=WRITER;
-        return _writer;
-    }
+			/* construct Writer using correct encoding */
+			_writer = _connection.getPrintWriter(encoding);
+		}
+		_outputState=WRITER;
+		return _writer;
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#setCharacterEncoding(java.lang.String)
-     */
-    public void setCharacterEncoding(String encoding)
-    {
-    	if (_connection.isIncluding())
-    		return;
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#setCharacterEncoding(java.lang.String)
+	 */
+	public void setCharacterEncoding(String encoding)
+	{
+		if (_connection.isIncluding())
+			return;
 
-        if (this._outputState==0 && !isCommitted())
-        {
-            _explicitEncoding=true;
+		if (this._outputState==0 && !isCommitted())
+		{
+			_explicitEncoding=true;
 
-            if (encoding==null)
-            {
-                // Clear any encoding.
-                if (_characterEncoding!=null)
-                {
-                    _characterEncoding=null;
-                    if (_cachedMimeType!=null)
-                        _contentType=_cachedMimeType.toString();
-                    else if (_mimeType!=null)
-                        _contentType=_mimeType;
-                    else
-                        _contentType=null;
+			if (encoding==null)
+			{
+				// Clear any encoding.
+				if (_characterEncoding!=null)
+				{
+					_characterEncoding=null;
+					if (_cachedMimeType!=null)
+						_contentType=_cachedMimeType.toString();
+					else if (_mimeType!=null)
+						_contentType=_mimeType;
+					else
+						_contentType=null;
 
-                    if (_contentType==null)
-                        _connection.getResponseFields().remove(HttpHeaders.CONTENT_TYPE_BUFFER);
-                    else
-                        _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                }
-            }
-            else
-            {
-                // No, so just add this one to the mimetype
-                _characterEncoding=encoding;
-                if (_contentType!=null)
-                {
-                    int i0=_contentType.indexOf(';');
-                    if (i0<0)
-                    {
-                        _contentType=null;
-                        if(_cachedMimeType!=null)
-                        {
-                            CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);
-                            if (content_type!=null)
-                            {
-                                _contentType=content_type.toString();
-                                _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);
-                            }
-                        }
+					if (_contentType==null)
+						_connection.getResponseFields().remove(HttpHeaders.CONTENT_TYPE_BUFFER);
+					else
+						_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+				}
+			}
+			else
+			{
+				// No, so just add this one to the mimetype
+				_characterEncoding=encoding;
+				if (_contentType!=null)
+				{
+					int i0=_contentType.indexOf(';');
+					if (i0<0)
+					{
+						_contentType=null;
+						if(_cachedMimeType!=null)
+						{
+							CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);
+							if (content_type!=null)
+							{
+								_contentType=content_type.toString();
+								_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);
+							}
+						}
 
-                        if (_contentType==null)
-                        {
-                            _contentType = _mimeType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
-                            _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                        }
-                    }
-                    else
-                    {
-                        int i1=_contentType.indexOf("charset=",i0);
-                        if (i1<0)
-                        {
-                            _contentType = _contentType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
-                        }
-                        else
-                        {
-                            int i8=i1+8;
-                            int i2=_contentType.indexOf(" ",i8);
-                            if (i2<0)
-                                _contentType=_contentType.substring(0,i8)+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
-                            else
-                                _contentType=_contentType.substring(0,i8)+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ")+_contentType.substring(i2);
-                        }
-                        _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                    }
-                }
-            }
-        }
-    }
+						if (_contentType==null)
+						{
+							_contentType = _mimeType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
+							_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+						}
+					}
+					else
+					{
+						int i1=_contentType.indexOf("charset=",i0);
+						if (i1<0)
+						{
+							_contentType = _contentType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
+						}
+						else
+						{
+							int i8=i1+8;
+							int i2=_contentType.indexOf(" ",i8);
+							if (i2<0)
+								_contentType=_contentType.substring(0,i8)+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
+							else
+								_contentType=_contentType.substring(0,i8)+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ")+_contentType.substring(i2);
+						}
+						_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+					}
+				}
+			}
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#setContentLength(int)
-     */
-    public void setContentLength(int len)
-    {
-        // Protect from setting after committed as default handling
-        // of a servlet HEAD request ALWAYS sets _content length, even
-        // if the getHandling committed the response!
-        if (isCommitted() || _connection.isIncluding())
-            return;
-        _connection._generator.setContentLength(len);
-        if (len>0)
-        {
-            _connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len);
-            if (_connection._generator.isAllContentWritten())
-            {
-                if (_outputState==WRITER)
-                    _writer.close();
-                else if (_outputState==STREAM)
-                {
-                    try
-                    {
-                        getOutputStream().close();
-                    }
-                    catch(IOException e)
-                    {
-                        throw new RuntimeException(e);
-                    }
-                }
-            }
-        }
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#setContentLength(int)
+	 */
+	public void setContentLength(int len)
+	{
+		// Protect from setting after committed as default handling
+		// of a servlet HEAD request ALWAYS sets _content length, even
+		// if the getHandling committed the response!
+		if (isCommitted() || _connection.isIncluding())
+			return;
+		_connection._generator.setContentLength(len);
+		if (len>0)
+		{
+			_connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len);
+			if (_connection._generator.isAllContentWritten())
+			{
+				if (_outputState==WRITER)
+					_writer.close();
+				else if (_outputState==STREAM)
+				{
+					try
+					{
+						getOutputStream().close();
+					}
+					catch(IOException e)
+					{
+						throw new RuntimeException(e);
+					}
+				}
+			}
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#setContentLength(int)
-     */
-    public void setLongContentLength(long len)
-    {
-        // Protect from setting after committed as default handling
-        // of a servlet HEAD request ALWAYS sets _content length, even
-        // if the getHandling committed the response!
-        if (isCommitted() || _connection.isIncluding())
-        	return;
-        _connection._generator.setContentLength(len);
-        _connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len);
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#setContentLength(int)
+	 */
+	public void setLongContentLength(long len)
+	{
+		// Protect from setting after committed as default handling
+		// of a servlet HEAD request ALWAYS sets _content length, even
+		// if the getHandling committed the response!
+		if (isCommitted() || _connection.isIncluding())
+			return;
+		_connection._generator.setContentLength(len);
+		_connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#setContentType(java.lang.String)
-     */
-    public void setContentType(String contentType)
-    {
-        if (isCommitted() || _connection.isIncluding())
-            return;
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#setContentType(java.lang.String)
+	 */
+	public void setContentType(String contentType)
+	{
+		if (isCommitted() || _connection.isIncluding())
+			return;
 
-        // Yes this method is horribly complex.... but there are lots of special cases and
-        // as this method is called on every request, it is worth trying to save string creation.
-        //
+		// Yes this method is horribly complex.... but there are lots of special cases and
+		// as this method is called on every request, it is worth trying to save string creation.
+		//
 
-        if (contentType==null)
-        {
-            if (_locale==null)
-                _characterEncoding=null;
-            _mimeType=null;
-            _cachedMimeType=null;
-            _contentType=null;
-            _connection.getResponseFields().remove(HttpHeaders.CONTENT_TYPE_BUFFER);
-        }
-        else
-        {
-            // Look for encoding in contentType
-            int i0=contentType.indexOf(';');
+		if (contentType==null)
+		{
+			if (_locale==null)
+				_characterEncoding=null;
+			_mimeType=null;
+			_cachedMimeType=null;
+			_contentType=null;
+			_connection.getResponseFields().remove(HttpHeaders.CONTENT_TYPE_BUFFER);
+		}
+		else
+		{
+			// Look for encoding in contentType
+			int i0=contentType.indexOf(';');
 
-            if (i0>0)
-            {
-                // we have content type parameters
+			if (i0>0)
+			{
+				// we have content type parameters
 
-                // Extract params off mimetype
-                _mimeType=contentType.substring(0,i0).trim();
-                _cachedMimeType=MimeTypes.CACHE.get(_mimeType);
+				// Extract params off mimetype
+				_mimeType=contentType.substring(0,i0).trim();
+				_cachedMimeType=MimeTypes.CACHE.get(_mimeType);
 
-                // Look for charset
-                int i1=contentType.indexOf("charset=",i0+1);
-                if (i1>=0)
-                {
-                    _explicitEncoding=true;
-                    int i8=i1+8;
-                    int i2 = contentType.indexOf(' ',i8);
+				// Look for charset
+				int i1=contentType.indexOf("charset=",i0+1);
+				if (i1>=0)
+				{
+					_explicitEncoding=true;
+					int i8=i1+8;
+					int i2 = contentType.indexOf(' ',i8);
 
-                    if (_outputState==WRITER)
-                    {
-                        // strip the charset and ignore;
-                        if ((i1==i0+1 && i2<0) || (i1==i0+2 && i2<0 && contentType.charAt(i0+1)==' '))
-                        {
-                            if (_cachedMimeType!=null)
-                            {
-                                CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);
-                                if (content_type!=null)
-                                {
-                                    _contentType=content_type.toString();
-                                    _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);
-                                }
-                                else
-                                {
-                                    _contentType=_mimeType+";charset="+_characterEncoding;
-                                    _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                                }
-                            }
-                            else
-                            {
-                                _contentType=_mimeType+";charset="+_characterEncoding;
-                                _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                            }
-                        }
-                        else if (i2<0)
-                        {
-                            _contentType=contentType.substring(0,i1)+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
-                            _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                        }
-                        else
-                        {
-                            _contentType=contentType.substring(0,i1)+contentType.substring(i2)+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
-                            _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                        }
-                    }
-                    else if ((i1==i0+1 && i2<0) || (i1==i0+2 && i2<0 && contentType.charAt(i0+1)==' '))
-                    {
-                        // The params are just the char encoding
-                        _cachedMimeType=MimeTypes.CACHE.get(_mimeType);
-                        _characterEncoding = QuotedStringTokenizer.unquote(contentType.substring(i8));
+					if (_outputState==WRITER)
+					{
+						// strip the charset and ignore;
+						if ((i1==i0+1 && i2<0) || (i1==i0+2 && i2<0 && contentType.charAt(i0+1)==' '))
+						{
+							if (_cachedMimeType!=null)
+							{
+								CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);
+								if (content_type!=null)
+								{
+									_contentType=content_type.toString();
+									_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);
+								}
+								else
+								{
+									_contentType=_mimeType+";charset="+_characterEncoding;
+									_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+								}
+							}
+							else
+							{
+								_contentType=_mimeType+";charset="+_characterEncoding;
+								_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+							}
+						}
+						else if (i2<0)
+						{
+							_contentType=contentType.substring(0,i1)+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
+							_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+						}
+						else
+						{
+							_contentType=contentType.substring(0,i1)+contentType.substring(i2)+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
+							_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+						}
+					}
+					else if ((i1==i0+1 && i2<0) || (i1==i0+2 && i2<0 && contentType.charAt(i0+1)==' '))
+					{
+						// The params are just the char encoding
+						_cachedMimeType=MimeTypes.CACHE.get(_mimeType);
+						_characterEncoding = QuotedStringTokenizer.unquote(contentType.substring(i8));
 
-                        if (_cachedMimeType!=null)
-                        {
-                            CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);
-                            if (content_type!=null)
-                            {
-                                _contentType=content_type.toString();
-                                _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);
-                            }
-                            else
-                            {
-                                _contentType=contentType;
-                                _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                            }
-                        }
-                        else
-                        {
-                            _contentType=contentType;
-                            _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                        }
-                    }
-                    else if (i2>0)
-                    {
-                        _characterEncoding = QuotedStringTokenizer.unquote(contentType.substring(i8,i2));
-                        _contentType=contentType;
-                        _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                    }
-                    else
-                    {
-                        _characterEncoding = QuotedStringTokenizer.unquote(contentType.substring(i8));
-                        _contentType=contentType;
-                        _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                    }
-                }
-                else // No encoding in the params.
-                {
-                    _cachedMimeType=null;
-                    _contentType=_characterEncoding==null?contentType:contentType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
-                    _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                }
-            }
-            else // No params at all
-            {
-                _mimeType=contentType;
-                _cachedMimeType=MimeTypes.CACHE.get(_mimeType);
+						if (_cachedMimeType!=null)
+						{
+							CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);
+							if (content_type!=null)
+							{
+								_contentType=content_type.toString();
+								_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);
+							}
+							else
+							{
+								_contentType=contentType;
+								_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+							}
+						}
+						else
+						{
+							_contentType=contentType;
+							_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+						}
+					}
+					else if (i2>0)
+					{
+						_characterEncoding = QuotedStringTokenizer.unquote(contentType.substring(i8,i2));
+						_contentType=contentType;
+						_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+					}
+					else
+					{
+						_characterEncoding = QuotedStringTokenizer.unquote(contentType.substring(i8));
+						_contentType=contentType;
+						_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+					}
+				}
+				else // No encoding in the params.
+				{
+					_cachedMimeType=null;
+					_contentType=_characterEncoding==null?contentType:contentType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
+					_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+				}
+			}
+			else // No params at all
+			{
+				_mimeType=contentType;
+				_cachedMimeType=MimeTypes.CACHE.get(_mimeType);
 
-                if (_characterEncoding!=null)
-                {
-                    if (_cachedMimeType!=null)
-                    {
-                        CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);
-                        if (content_type!=null)
-                        {
-                            _contentType=content_type.toString();
-                            _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);
-                        }
-                        else
-                        {
-                            _contentType=_mimeType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
-                            _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                        }
-                    }
-                    else
-                    {
-                        _contentType=contentType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
-                        _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                    }
-                }
-                else if (_cachedMimeType!=null)
-                {
-                    _contentType=_cachedMimeType.toString();
-                    _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_cachedMimeType);
-                }
-                else
-                {
-                    _contentType=contentType;
-                    _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-                }
-            }
-        }
-    }
+				if (_characterEncoding!=null)
+				{
+					if (_cachedMimeType!=null)
+					{
+						CachedBuffer content_type = _cachedMimeType.getAssociate(_characterEncoding);
+						if (content_type!=null)
+						{
+							_contentType=content_type.toString();
+							_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type);
+						}
+						else
+						{
+							_contentType=_mimeType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
+							_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+						}
+					}
+					else
+					{
+						_contentType=contentType+";charset="+QuotedStringTokenizer.quoteIfNeeded(_characterEncoding,";= ");
+						_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+					}
+				}
+				else if (_cachedMimeType!=null)
+				{
+					_contentType=_cachedMimeType.toString();
+					_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_cachedMimeType);
+				}
+				else
+				{
+					_contentType=contentType;
+					_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+				}
+			}
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#setBufferSize(int)
-     */
-    public void setBufferSize(int size)
-    {
-        if (isCommitted() || getContentCount()>0)
-            throw new IllegalStateException("Committed or content written");
-        _connection.getGenerator().increaseContentBufferSize(size);
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#setBufferSize(int)
+	 */
+	public void setBufferSize(int size)
+	{
+		if (isCommitted() || getContentCount()>0)
+			throw new IllegalStateException("Committed or content written");
+		_connection.getGenerator().increaseContentBufferSize(size);
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#getBufferSize()
-     */
-    public int getBufferSize()
-    {
-        return _connection.getGenerator().getContentBufferSize();
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#getBufferSize()
+	 */
+	public int getBufferSize()
+	{
+		return _connection.getGenerator().getContentBufferSize();
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#flushBuffer()
-     */
-    public void flushBuffer() throws IOException
-    {
-        _connection.flushResponse();
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#flushBuffer()
+	 */
+	public void flushBuffer() throws IOException
+	{
+		_connection.flushResponse();
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#reset()
-     */
-    public void reset()
-    {
-        resetBuffer();
-        fwdReset();
-        _status=200;
-        _reason=null;
-        
-        HttpFields response_fields=_connection.getResponseFields();
-        
-        response_fields.clear();
-        String connection=_connection.getRequestFields().getStringField(HttpHeaders.CONNECTION_BUFFER);
-        if (connection!=null)
-        {
-            String[] values = connection.split(",");
-            for  (int i=0;values!=null && i<values.length;i++)
-            {
-                CachedBuffer cb = HttpHeaderValues.CACHE.get(values[0].trim());
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#reset()
+	 */
+	public void reset()
+	{
+		resetBuffer();
+		fwdReset();
+		_status=200;
+		_reason=null;
+		
+		HttpFields response_fields=_connection.getResponseFields();
+		
+		response_fields.clear();
+		String connection=_connection.getRequestFields().getStringField(HttpHeaders.CONNECTION_BUFFER);
+		if (connection!=null)
+		{
+			String[] values = connection.split(",");
+			for  (int i=0;values!=null && i<values.length;i++)
+			{
+				CachedBuffer cb = HttpHeaderValues.CACHE.get(values[0].trim());
 
-                if (cb!=null)
-                {
-                    switch(cb.getOrdinal())
-                    {
-                        case HttpHeaderValues.CLOSE_ORDINAL:
-                            response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.CLOSE_BUFFER);
-                            break;
+				if (cb!=null)
+				{
+					switch(cb.getOrdinal())
+					{
+						case HttpHeaderValues.CLOSE_ORDINAL:
+							response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.CLOSE_BUFFER);
+							break;
 
-                        case HttpHeaderValues.KEEP_ALIVE_ORDINAL:
-                            if (HttpVersions.HTTP_1_0.equalsIgnoreCase(_connection.getRequest().getProtocol()))
-                                response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.KEEP_ALIVE);
-                            break;
-                        case HttpHeaderValues.TE_ORDINAL:
-                            response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.TE);
-                            break;
-                    }
-                }
-            }
-        }
-    }
-    
+						case HttpHeaderValues.KEEP_ALIVE_ORDINAL:
+							if (HttpVersions.HTTP_1_0.equalsIgnoreCase(_connection.getRequest().getProtocol()))
+								response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.KEEP_ALIVE);
+							break;
+						case HttpHeaderValues.TE_ORDINAL:
+							response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.TE);
+							break;
+					}
+				}
+			}
+		}
+	}
+	
 
-    public void reset(boolean preserveCookies)
-    { 
-        if (!preserveCookies)
-            reset();
-        else
-        {
-            HttpFields response_fields=_connection.getResponseFields();
+	public void reset(boolean preserveCookies)
+	{ 
+		if (!preserveCookies)
+			reset();
+		else
+		{
+			HttpFields response_fields=_connection.getResponseFields();
 
-            ArrayList<String> cookieValues = new ArrayList<String>(5);
-            Enumeration<String> vals = response_fields.getValues(HttpHeaders.SET_COOKIE);
-            while (vals.hasMoreElements())
-                cookieValues.add((String)vals.nextElement());
+			ArrayList<String> cookieValues = new ArrayList<String>(5);
+			Enumeration<String> vals = response_fields.getValues(HttpHeaders.SET_COOKIE);
+			while (vals.hasMoreElements())
+				cookieValues.add((String)vals.nextElement());
 
-            reset();
+			reset();
 
-            for (String v:cookieValues)
-                response_fields.add(HttpHeaders.SET_COOKIE, v);
-        }
-    }
-    
-    
-    
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#reset()
-     */
-    public void fwdReset()
-    {
-        resetBuffer();
+			for (String v:cookieValues)
+				response_fields.add(HttpHeaders.SET_COOKIE, v);
+		}
+	}
+	
+	
+	
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#reset()
+	 */
+	public void fwdReset()
+	{
+		resetBuffer();
 
-        _writer=null;
-        _outputState=NONE;
-    }
+		_writer=null;
+		_outputState=NONE;
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#resetBuffer()
-     */
-    public void resetBuffer()
-    {
-        if (isCommitted())
-            throw new IllegalStateException("Committed");
-        _connection.getGenerator().resetBuffer();
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#resetBuffer()
+	 */
+	public void resetBuffer()
+	{
+		if (isCommitted())
+			throw new IllegalStateException("Committed");
+		_connection.getGenerator().resetBuffer();
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#isCommitted()
-     */
-    public boolean isCommitted()
-    {
-        return _connection.isResponseCommitted();
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#isCommitted()
+	 */
+	public boolean isCommitted()
+	{
+		return _connection.isResponseCommitted();
+	}
 
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#setLocale(java.util.Locale)
-     */
-    public void setLocale(Locale locale)
-    {
-        if (locale == null || isCommitted() ||_connection.isIncluding())
-            return;
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#setLocale(java.util.Locale)
+	 */
+	public void setLocale(Locale locale)
+	{
+		if (locale == null || isCommitted() ||_connection.isIncluding())
+			return;
 
-        _locale = locale;
-        _connection.getResponseFields().put(HttpHeaders.CONTENT_LANGUAGE_BUFFER,locale.toString().replace('_','-'));
+		_locale = locale;
+		_connection.getResponseFields().put(HttpHeaders.CONTENT_LANGUAGE_BUFFER,locale.toString().replace('_','-'));
 
-        if (_explicitEncoding || _outputState!=0 )
-            return;
+		if (_explicitEncoding || _outputState!=0 )
+			return;
 
-        if (_connection.getRequest().getContext()==null)
-            return;
+		if (_connection.getRequest().getContext()==null)
+			return;
 
-        String charset = _connection.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
+		String charset = _connection.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
 
-        if (charset!=null && charset.length()>0)
-        {
-            _characterEncoding=charset;
+		if (charset!=null && charset.length()>0)
+		{
+			_characterEncoding=charset;
 
-            /* get current MIME type from Content-Type header */
-            String type=getContentType();
-            if (type!=null)
-            {
-                _characterEncoding=charset;
-                int semi=type.indexOf(';');
-                if (semi<0)
-                {
-                    _mimeType=type;
-                    _contentType= type += ";charset="+charset;
-                }
-                else
-                {
-                    _mimeType=type.substring(0,semi);
-                    _contentType= _mimeType += ";charset="+charset;
-                }
+			/* get current MIME type from Content-Type header */
+			String type=getContentType();
+			if (type!=null)
+			{
+				_characterEncoding=charset;
+				int semi=type.indexOf(';');
+				if (semi<0)
+				{
+					_mimeType=type;
+					_contentType= type += ";charset="+charset;
+				}
+				else
+				{
+					_mimeType=type.substring(0,semi);
+					_contentType= _mimeType += ";charset="+charset;
+				}
 
-                _cachedMimeType=MimeTypes.CACHE.get(_mimeType);
-                _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
-            }
-        }
-    }
+				_cachedMimeType=MimeTypes.CACHE.get(_mimeType);
+				_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
+			}
+		}
+	}
 
-    /* ------------------------------------------------------------ */
-    /*
-     * @see javax.servlet.ServletResponse#getLocale()
-     */
-    public Locale getLocale()
-    {
-        if (_locale==null)
-            return Locale.getDefault();
-        return _locale;
-    }
+	/* ------------------------------------------------------------ */
+	/*
+	 * @see javax.servlet.ServletResponse#getLocale()
+	 */
+	public Locale getLocale()
+	{
+		if (_locale==null)
+			return Locale.getDefault();
+		return _locale;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * @return The HTTP status code that has been set for this request. This will be <code>200<code>
-     *    ({@link HttpServletResponse#SC_OK}), unless explicitly set through one of the <code>setStatus</code> methods.
-     */
-    public int getStatus()
-    {
-        return _status;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * @return The HTTP status code that has been set for this request. This will be <code>200<code>
+	 *    ({@link HttpServletResponse#SC_OK}), unless explicitly set through one of the <code>setStatus</code> methods.
+	 */
+	public int getStatus()
+	{
+		return _status;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     * @return The reason associated with the current {@link #getStatus() status}. This will be <code>null</code>,
-     *    unless one of the <code>setStatus</code> methods have been called.
-     */
-    public String getReason()
-    {
-        return _reason;
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 * @return The reason associated with the current {@link #getStatus() status}. This will be <code>null</code>,
+	 *    unless one of the <code>setStatus</code> methods have been called.
+	 */
+	public String getReason()
+	{
+		return _reason;
+	}
 
-    /* ------------------------------------------------------------ */
-    /**
-     */
-    public void complete()
-        throws IOException
-    {
-        _connection.completeResponse();
-    }
+	/* ------------------------------------------------------------ */
+	/**
+	 */
+	public void complete()
+		throws IOException
+	{
+		_connection.completeResponse();
+	}
 
-    /* ------------------------------------------------------------- */
-    /**
-     * @return the number of bytes actually written in response body
-     */
-    public long getContentCount()
-    {
-        if (_connection==null || _connection.getGenerator()==null)
-            return -1;
-        return _connection.getGenerator().getContentWritten();
-    }
+	/* ------------------------------------------------------------- */
+	/**
+	 * @return the number of bytes actually written in response body
+	 */
+	public long getContentCount()
+	{
+		if (_connection==null || _connection.getGenerator()==null)
+			return -1;
+		return _connection.getGenerator().getContentWritten();
+	}
 
-    /* ------------------------------------------------------------ */
-    public HttpFields getHttpFields()
-    {
-        return _connection.getResponseFields();
-    }
+	/* ------------------------------------------------------------ */
+	public HttpFields getHttpFields()
+	{
+		return _connection.getResponseFields();
+	}
 
-    /* ------------------------------------------------------------ */
-    @Override
-    public String toString()
-    {
-        return "HTTP/1.1 "+_status+" "+ (_reason==null?"":_reason) +System.getProperty("line.separator")+
-        _connection.getResponseFields().toString();
-    }
-    
-    /* ------------------------------------------------------------ */
-    /* ------------------------------------------------------------ */
-    /* ------------------------------------------------------------ */
-    private static class NullOutput extends ServletOutputStream
-    {
-        @Override
-        public void write(int b) throws IOException
-        {
-        }
+	/* ------------------------------------------------------------ */
+	@Override
+	public String toString()
+	{
+		return "HTTP/1.1 "+_status+" "+ (_reason==null?"":_reason) +System.getProperty("line.separator")+
+		_connection.getResponseFields().toString();
+	}
+	
+	/* ------------------------------------------------------------ */
+	/* ------------------------------------------------------------ */
+	/* ------------------------------------------------------------ */
+	private static class NullOutput extends ServletOutputStream
+	{
+		@Override
+		public void write(int b) throws IOException
+		{
+		}
 
-        @Override
-        public void print(String s) throws IOException
-        {
-        }
+		@Override
+		public void print(String s) throws IOException
+		{
+		}
 
-        @Override
-        public void println(String s) throws IOException
-        {
-        }
+		@Override
+		public void println(String s) throws IOException
+		{
+		}
 
-        @Override
-        public void write(byte[] b, int off, int len) throws IOException
-        {
-        }
+		@Override
+		public void write(byte[] b, int off, int len) throws IOException
+		{
+		}
 
-    }
+	}
 
 }
--- a/src/org/eclipse/jetty/server/UserIdentity.java	Thu Sep 08 21:44:37 2016 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-//
-//  ========================================================================
-//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
-//  ------------------------------------------------------------------------
-//  All rights reserved. This program and the accompanying materials
-//  are made available under the terms of the Eclipse Public License v1.0
-//  and Apache License v2.0 which accompanies this distribution.
-//
-//      The Eclipse Public License is available at
-//      http://www.eclipse.org/legal/epl-v10.html
-//
-//      The Apache License v2.0 is available at
-//      http://www.opensource.org/licenses/apache2.0.php
-//
-//  You may elect to redistribute this code under either of these licenses.
-//  ========================================================================
-//
-
-package org.eclipse.jetty.server;
-import java.security.Principal;
-import java.util.Map;
-
-import javax.security.auth.Subject;
-
-/* ------------------------------------------------------------ */
-/** User object that encapsulates user identity and operations such as run-as-role actions, 
- * checking isUserInRole and getUserPrincipal.
- *
- * Implementations of UserIdentity should be immutable so that they may be
- * cached by Authenticators and LoginServices.
- *
- */
-public interface UserIdentity
-{
-    /* ------------------------------------------------------------ */
-    /**
-     * @return The user subject
-     */
-    Subject getSubject();
-
-    /* ------------------------------------------------------------ */
-    /**
-     * @return The user principal
-     */
-    Principal getUserPrincipal();
-
-    /* ------------------------------------------------------------ */
-    /** Check if the user is in a role.
-     * This call is used to satisfy authorization calls from 
-     * container code which will be using translated role names.
-     * @param role A role name.
-     * @param scope
-     * @return True if the user can act in that role.
-     */
-    boolean isUserInRole(String role, Scope scope);
-    
-
-    /* ------------------------------------------------------------ */
-    /**
-     * A UserIdentity Scope.
-     * A scope is the environment in which a User Identity is to 
-     * be interpreted. Typically it is set by the target servlet of 
-     * a request.
-     */
-    interface Scope
-    {
-        /* ------------------------------------------------------------ */
-        /**
-         * @return The context path that the identity is being considered within
-         */
-        String getContextPath();
-        
-        /* ------------------------------------------------------------ */
-        /**
-         * @return The name of the identity context. Typically this is the servlet name.
-         */
-        String getName();
-        
-        /* ------------------------------------------------------------ */
-        /**
-         * @return A map of role reference names that converts from names used by application code
-         * to names used by the context deployment.
-         */
-        Map<String,String> getRoleRefMap();
-    }
-    
-    /* ------------------------------------------------------------ */
-    public interface UnauthenticatedUserIdentity extends UserIdentity
-    {
-    }
-
-    /* ------------------------------------------------------------ */
-    public static final UserIdentity UNAUTHENTICATED_IDENTITY = new UnauthenticatedUserIdentity()
-    {
-        public Subject getSubject()
-        {
-            return null;
-        }
-        
-        public Principal getUserPrincipal()
-        {
-            return null;
-        }
-        
-        public boolean isUserInRole(String role, Scope scope)
-        {
-            return false;
-        }
-        
-        @Override
-        public String toString()
-        {
-            return "UNAUTHENTICATED";
-        }
-    };
-}