getLog() .warn( template + " line " + lineNumber + ": Property " + propName + " not defined in DSpace configuration - " + "using empty string");
warn(template + " line " + lineNumber + ": Property " + propName + " not defined in DSpace configuration - " + "using empty string");
    private static void installConfigurationFile(String template)            throws IOException    {        // Get the destination: specified in property config.template.XXX        String destination = getProperty("config.template." + template);        if (destination == null)        {            // If no destination is specified            getLog().info(                    "Not processing config file template " + template                            + " because no destination specified (no property "                            + "config.template." + template + ")");            return;        }        getLog().info(                "Installing configuration file template " + template + " to "                        + destination);        // Open the template        BufferedReader in = new BufferedReader(new FileReader(                getProperty("dspace.dir") + File.separator + "config"                        + File.separator + "templates" + File.separator                        + template));        // Open the destination for writing        PrintWriter out = new PrintWriter(new FileWriter(destination));        // We'll keep track of line numbers for error messages etc.        int lineNumber = 0;        String line;        // Copy the template, filling out config values        while ((line = in.readLine()) != null)        {            lineNumber++;            // Find configuration values            boolean moreValues = true;            while (moreValues)            {                // Look for "@@"                int first = line.indexOf("@@");                if (first > -1)                {                    // Look for the "@@" on the other side                    int second = line.indexOf("@@", first + 2);                    if (second > -1)                    {                        // We have a property                        String propName = line.substring(first + 2, second);                        String propValue = getProperty(propName);                        if (propValue == null)                        {                            getLog()                                    .warn(                                            template                                                    + " line "                                                    + lineNumber                                                    + ": Property "                                                    + propName                                                    + " not defined in DSpace configuration - "                                                    + "using empty string");                            propValue = "";                        }                        // Fill in the value                        line = line.substring(0, first) + propValue                                + line.substring(second + 2);                    }                    else                    {                        // There's a "@@" with no second one... just leave as-is                        getLog().warn(                                template + " line " + lineNumber                                        + ": Single @@ - leaving as-is");                        moreValues = false;                    }                }                else                {                    // No more @@'s                    moreValues = false;                }            }            // Write the line            out.println(line);        }        in.close();        out.close();    }