String logDirectory = servletConfig.getServletContext( )
String logDirectory = servletContext
	private ReportEngineService( ServletConfig servletConfig )	{		System.setProperty( "RUN_UNDER_ECLIPSE", "false" ); //$NON-NLS-1$ //$NON-NLS-2$		if ( servletConfig == null )		{			return;		}		config = new EngineConfig( );		// Register new image handler		HTMLEmitterConfig emitterConfig = new HTMLEmitterConfig( );		emitterConfig.setActionHandler( new HTMLActionHandler( ) );		imageHandler = new HTMLServerImageHandler( );		emitterConfig.setImageHandler( imageHandler );		config.getEmitterConfigs( ).put( "html", emitterConfig ); //$NON-NLS-1$		// Prepare image directory.		imageDirectory = servletConfig.getServletContext( )				.getInitParameter( ParameterAccessor.INIT_PARAM_IMAGE_DIR );		if ( imageDirectory == null				|| imageDirectory.trim( ).length( ) <= 0				|| ParameterAccessor.isRelativePath( imageDirectory ) )		{			imageDirectory = ParameterAccessor.getRealPath( servletConfig.getServletContext( ),					"/report/images" ); //$NON-NLS-1$		}		// Prepare image base url.		imageBaseUrl = IBirtConstants.SERVLET_PATH_PREVIEW + "?__imageID="; //$NON-NLS-1$		// Prepare log directory.		String logDirectory = servletConfig.getServletContext( )				.getInitParameter( ParameterAccessor.INIT_PARAM_LOG_DIR );		if ( logDirectory == null				|| logDirectory.trim( ).length( ) <= 0				|| ParameterAccessor.isRelativePath( logDirectory ) )		{			logDirectory = ParameterAccessor.getRealPath( servletConfig.getServletContext( ),					"/logs" ); //$NON-NLS-1$		}		// Prepare log level.		String logLevel = servletConfig.getServletContext( )				.getInitParameter( ParameterAccessor.INIT_PARAM_LOG_LEVEL );		Level level = logLevel != null && logLevel.length( ) > 0 ? Level.parse( logLevel )				: Level.OFF;		config.setLogConfig( logDirectory, level );		// Prepare ScriptLib location		String scriptLibDir = servletConfig.getServletContext( )				.getInitParameter( ParameterAccessor.INIT_PARAM_SCRIPTLIB_DIR );		if ( scriptLibDir == null				|| scriptLibDir.trim( ).length( ) <= 0				|| ParameterAccessor.isRelativePath( scriptLibDir ) )		{			scriptLibDir = ParameterAccessor.getRealPath( servletConfig.getServletContext( ),					"/scriptlib" ); //$NON-NLS-1$		}		ArrayList jarFileList = new ArrayList( );		if ( scriptLibDir != null )		{			File dir = new File( scriptLibDir );			getAllJarFiles( dir, jarFileList );		}		String scriptlibClassPath = ""; //$NON-NLS-1$		for ( int i = 0; i < jarFileList.size( ); i++ )			scriptlibClassPath += EngineConstants.PROPERTYSEPARATOR					+ ( (File) jarFileList.get( i ) ).getAbsolutePath( );		if ( scriptlibClassPath.startsWith( EngineConstants.PROPERTYSEPARATOR ) )			scriptlibClassPath = scriptlibClassPath.substring( EngineConstants.PROPERTYSEPARATOR.length( ) );		System.setProperty( EngineConstants.WEBAPP_CLASSPATH_KEY,				scriptlibClassPath );		config.setEngineHome( "" ); //$NON-NLS-1$	}