_context = (ContextHandler.Context)config;
_context = (ContextHandler.SContext)config;
    public void init()        throws UnavailableException    {        ServletContext config=getServletContext();        _context = (ContextHandler.Context)config;        _mimeTypes = _context.getContextHandler().getMimeTypes();                _welcomes = _context.getContextHandler().getWelcomeFiles();        if (_welcomes==null)            _welcomes=new String[] {"index.jsp","index.html"};                _acceptRanges=getInitBoolean("acceptRanges",_acceptRanges);        _dirAllowed=getInitBoolean("dirAllowed",_dirAllowed);        _redirectWelcome=getInitBoolean("redirectWelcome",_redirectWelcome);        _gzip=getInitBoolean("gzip",_gzip);                _aliases=getInitBoolean("aliases",_aliases);        _useFileMappedBuffer=getInitBoolean("useFileMappedBuffer",_useFileMappedBuffer);                String rrb = getInitParameter("relativeResourceBase");        if (rrb!=null)        {            try            {                _resourceBase=Resource.newResource(_context.getResource("/")).addPath(rrb);            }            catch (Exception e)             {                Log.warn(Log.EXCEPTION,e);                throw new UnavailableException(e.toString());             }        }                String rb=getInitParameter("resourceBase");        if (rrb != null && rb != null)            throw new  UnavailableException("resourceBase & relativeResourceBase");                    if (rb!=null)        {            try{_resourceBase=Resource.newResource(rb);}            catch (Exception e) {                Log.warn(Log.EXCEPTION,e);                throw new UnavailableException(e.toString());             }        }                try        {            if (_resourceBase==null)                _resourceBase=Resource.newResource(_context.getResource("/"));            int max_cache_size=getInitInt("maxCacheSize", -2);            if (max_cache_size==-2 || max_cache_size>0)            {                if (_cache==null)                    _cache=new NIOResourceCache(_mimeTypes);                                if (max_cache_size>0)		    _cache.setMaxCacheSize(max_cache_size);                }            else                _cache=null;                        if (_cache!=null)            {                int max_cached_file_size=getInitInt("maxCachedFileSize", -2);                if (max_cached_file_size>=-1)                    _cache.setMaxCachedFileSize(max_cached_file_size);                                    int max_cached_files=getInitInt("maxCachedFiles", -2);                if (max_cached_files>=-1)                    _cache.setMaxCachedFiles(max_cached_files);                                _cache.start();            }        }        catch (Exception e)         {            Log.warn(Log.EXCEPTION,e);            throw new UnavailableException(e.toString());         }                if (Log.isDebugEnabled()) Log.debug("resource base = "+_resourceBase);    }