String versioncfg = "/WEB-INF/" + VERSIONCONFIGFILE;
	public void init() throws ServletException	{		ServletContext context = getServletContext();		dataSource = context.getInitParameter("dataSource");		String s = context.getInitParameter("dirmappings");		dirmapping = new Properties();		if (null != s)		{			StringTokenizer st = new StringTokenizer(s, ",");			while (st.hasMoreTokens())			{				String s1 = st.nextToken();				int p = s1.indexOf('=');				if (p > -1)				{					String key = s1.substring(0, p);					String val = s1.substring(p + 1);					dirmapping.setProperty(key, val);				}			}		}		s = context.getInitParameter("useDataBase");		if (null != s)		{			useDataBase = Boolean.valueOf(s).booleanValue();			initDBConnection();		}		InputStream is = context.getResourceAsStream("/WEB-INF/" + CONFIGFILE);		try		{			configuration = new Configuration(is);			s = context.getInitParameter("thumbnailWriter");			Object o = Class.forName(s).newInstance();			configuration.setThumbnailWriter((IThumbnailWriter) o);		}		catch (Exception e)		{			throw new ServletException(e.getMessage());		}		if (is != null)		{			try			{				is.close();			}			catch (IOException e)			{				throw new ServletException(e.getMessage());			}		}				// Parameters from the config file in WEB-INF can be overridden from parameters 		// in the context configuration				Configuration configurationFromContext = null;		Enumeration en = context.getInitParameterNames();		while (en.hasMoreElements())		{			if (configurationFromContext == null)			{				configuration = configurationFromContext = new Configuration(configuration);			}			s = (String)en.nextElement();			String s1 = context.getInitParameter(s);			configurationFromContext.addProperty(s,s1);		}								is = context.getResourceAsStream("/WEB-INF/" + WEBDIRSFILE);		if (null != is)		{			try			{				webDirectories = new Properties();				webDirectories.load(is);				for (en = webDirectories.keys(); en.hasMoreElements();)				{					webKeys.add(en.nextElement());				}			}			catch (IOException e)			{				throw new ServletException(e.getMessage());			}		}		if (is != null)		{			try			{				is.close();			}			catch (IOException e)			{				throw new ServletException(e.getMessage());			}		}		try		{			is = context.getResourceAsStream("/WEB-INF/" + VERSIONCONFIGFILE);			Properties versionProperties = new Properties();			versionProperties.load(is);			s = versionProperties.getProperty("version");			if (null != s)			{				version = s;			}		}		catch (Exception e)		{			e.printStackTrace(System.err); // TODO		}		if (is != null)		{			try			{				is.close();			}			catch (IOException e)			{				throw new ServletException(e.getMessage());			}		}	}