class BatchOperations {

    protected String replaceLocationPlaceholders( String str,
                                                  Map<Integer, String> locations )
    {
        if ( !str.contains( "{" ) )
        {
            return str;
        }
        Matcher matcher = PLACEHOLDER_PATTERN.matcher( str );
        StringBuffer sb = new StringBuffer();
        String replacement = null;
        while ( matcher.find() )
        {
            String id = matcher.group( 1 );
            try
            {
                replacement = locations.get( Integer.valueOf( id ) );
            }
            catch ( NumberFormatException e )
            {
                // The body contained a value that happened to match our regex, but is not a valid integer.
                // Specifically, the digits inside the brackets must have been > 2^31-1.
                // Simply ignore this, since we don't support non-integer placeholders, this is not a valid placeholder
            }
            if ( replacement != null )
            {
                matcher.appendReplacement( sb, replacement );
            }
            else
            {
                matcher.appendReplacement( sb, matcher.group() );
            }
        }
        matcher.appendTail( sb );
        return sb.toString();
    }

    public  BatchOperations( WebServer webServer );

}