BufferedReader br = new BufferedReader(new FileReader(licenseFile));
FileInputStream fir = new FileInputStream(licenseFile); InputStreamReader ir = new InputStreamReader(fir, "UTF-8"); BufferedReader br = new BufferedReader(ir);
    public static void loadConfig(String configFile)    {        InputStream is;        if (properties != null)        {            return;        }        String configProperty = System.getProperty("dspace.configuration");        try        {            if (configFile != null)            {                is = new FileInputStream(configFile);                loadedFile = new File(configFile);            }            // Has the default configuration location been overridden?            else if (configProperty != null)            {                // Load the overriding configuration                is = new FileInputStream(configProperty);                loadedFile = new File(configProperty);            }            else            {                // Load configuration from default location                is = ConfigurationManager.class                        .getResourceAsStream("/dspace.cfg");                loadedFile = new File(ConfigurationManager.class.getResource(                        "/dspace.cfg").getPath());            }            if (is == null)            {                fatal("Cannot find dspace.cfg");                System.exit(1);            }            else            {                properties = new Properties();                properties.load(is);                // walk values, interpolating any embedded references.                for (Enumeration pe = properties.propertyNames(); pe.hasMoreElements(); )                {                    String key = (String)pe.nextElement();                    String value = interpolate(key, 1);                    if (value != null)                        properties.setProperty(key, value);                }            }            // Load in default license            String licenseFile = getProperty("dspace.dir") + File.separator                    + "config" + File.separator + "default.license";            BufferedReader br = new BufferedReader(new FileReader(licenseFile));            String lineIn;            license = "";            while ((lineIn = br.readLine()) != null)            {                license = license + lineIn + '\n';            }            is.close();            // Load in log4j config            // Load the log4j config, if a log4j.xml version exists use that            // configuration format over the log4j.properties version            String log4jConfProp = ConfigurationManager                    .getProperty("dspace.dir")                    + File.separator                    + "config"                    + File.separator                    + "log4j.properties";            String log4jConfXml = ConfigurationManager                    .getProperty("dspace.dir")                    + File.separator + "config" + File.separator + "log4j.xml";            File xmlFile = new File(log4jConfXml);            if (xmlFile.exists())            {                try                {                    DOMConfigurator.configure(xmlFile.toURL());                    initLog();                    info("DSpace logging installed using log4j.xml");                }                catch (MalformedURLException e)                {                    PropertyConfigurator.configure(log4jConfProp);                    initLog();                    error("Logger failed to load log4j.xml, defaulted to "                            + "log4j.properties: " + e);                }            }            else            {                PropertyConfigurator.configure(log4jConfProp);                initLog();                info("DSpace logging installed using log4j.properties");            }        }        catch (IOException e)        {            fatal("Can't load configuration", e);            // FIXME: Maybe something more graceful here, but with the            // configuration we can't do anything            System.exit(1);        }    }