## Merging multiple files

In some cases, the ability to merge files without the assist of a user is desirable. The extension point org.eclipse.team.core.storageMergers allows you to contribute a class that merges three different files (or storage units) into a single output stream. Storage mergers can be associated with file extensions or bound to a particular content type. The Platform defines a storage merger for merging three files of plain text:

    <extension
    	point="org.eclipse.team.core.storageMergers">
    	<storageMerger
    		extensions="txt"
    		class="org.eclipse.team.internal.ui.mapping.TextStorageMerger"
    		id="org.eclipse.team.ui.textStorageMerger">
    	</storageMerger>
    	<contentTypeBinding
    		contentTypeId="org.eclipse.core.runtime.text"
    		streamMergerId="org.eclipse.team.ui.textStorageMerger">
    	</contentTypeBinding>
    </extension>

The storage merger itself is described in the storageMerger element. You must specify the id of the merger and the class that implements it. You may also specify any file extensions for which the the storage merger should be used.

You may also use the contentTypeBinding element to associate a content type with a storage merger.

Storage mergers must implement IStorageMerger. This simple interface merges the contents from three different storage units into a single output stream. The not-so-simple implementation depends upon your plug-in and its content types.