void createReplacementsFile(AbstractApplicationLauncher launcher) throws IOException {

        FileInputStream in = new FileInputStream(templateFile);
        ByteArrayOutputStream tmp = new ByteArrayOutputStream();

        byte[] buf = new byte[4096];
        int read;

        while ((read = in.read(buf)) > -1) {
            tmp.write(buf, 0, read);
        }

        // First replace all standard parameters etc
        String outputContent = launcher.replaceTokens(new String(tmp.toByteArray(), encoding));

        for (Enumeration e = tokens.keys(); e.hasMoreElements();) {

            String token = (String) e.nextElement();
            String value = (String) tokens.get(token);

            if (launcher.events != null)
                launcher.events.debug(MessageFormat.format(Messages.getString("FileReplacement.processingReplacement"), new Object[] { token, value } ) ); //$NON-NLS-1$ //$NON-NLS-2$

            // Perform replacement in String
            outputContent = AbstractApplicationLauncher.replaceAllTokens(outputContent, token, value);

        }
        
        if(convertLineEndings != null && !convertLineEndings.equals(PLATFORM_EOL)) {
	        BufferedReader br = new BufferedReader(new StringReader(outputContent));
	        String line = null;
	        PrintWriter pw = new PrintWriter(new FileOutputStream(outputFile));
	        try {
	        	while( ( line = br.readLine() ) != null) {
	        		if(DOS_EOL.equals(convertLineEndings)) {
	        			pw.print(line + "\r\n");
	        		}
	        		else if(UNIX_EOL.equals(convertLineEndings)) {
	        			pw.print(line + "\n");
	        		}
	        		else if(MAC_EOL.equals(convertLineEndings)) {
	        			pw.print(line + "\r");
	        		}
	        		else {
	        			pw.println(line);
	        		}
	        	}
	        } finally {
	            pw.close();
	        }
        }
        else {
            FileOutputStream out = new FileOutputStream(outputFile);
            try {
                out.write(outputContent.getBytes(encoding));
            } finally {
                out.close();
            }
		}


    }