logDirectory = servletConfig.getServletContext( ).getRealPath( "/logs" );
logDirectory = ParameterAccessor.getRealPath( servletConfig .getServletContext( ), "/logs" );
	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 = servletConfig.getServletContext( ).getRealPath(					"/report/images" ); //$NON-NLS-1$		}		// Prepare image base url.		imageBaseUrl = "/run?__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 = servletConfig.getServletContext( ).getRealPath(					"/logs" ); //$NON-NLS-1$		}		// Prepare log level.		String logLevel = servletConfig.getServletContext( ).getInitParameter(				ParameterAccessor.INIT_PARAM_LOG_LEVEL );		Level level = Level.OFF;		if ( "SEVERE".equalsIgnoreCase( logLevel ) ) //$NON-NLS-1$		{			level = Level.SEVERE;		}		else if ( "WARNING".equalsIgnoreCase( logLevel ) ) //$NON-NLS-1$		{			level = Level.WARNING;		}		else if ( "INFO".equalsIgnoreCase( logLevel ) ) //$NON-NLS-1$		{			level = Level.INFO;		}		else if ( "CONFIG".equalsIgnoreCase( logLevel ) ) //$NON-NLS-1$		{			level = Level.CONFIG;		}		else if ( "FINE".equalsIgnoreCase( logLevel ) ) //$NON-NLS-1$		{			level = Level.FINE;		}		else if ( "FINER".equalsIgnoreCase( logLevel ) ) //$NON-NLS-1$		{			level = Level.FINER;		}		else if ( "FINEST".equalsIgnoreCase( logLevel ) ) //$NON-NLS-1$		{			level = Level.FINEST;		}		else if ( "OFF".equalsIgnoreCase( logLevel ) ) //$NON-NLS-1$		{			level = 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 = servletConfig.getServletContext( ).getRealPath(					"/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$	}