be.re.repo
Interface Compare


public interface Compare

The interface for external modules that present the differences between two resources. Such modules are declared in /configuration/maps.xml using the compare element as in the following example:

 <compare>
   <mime-type>text/*</mime-type>
   <!-- Additional mime-type elements can come here. -->
   <!-- Several path elements can come here. -->
   <class>
     <name>be.re.repo.mod.CompareText</name>
     <!-- Optional URL relative to maps.xml.
     <jar>modules/my_module.jar</jar>
     -->
   </class>
 </compare>
 
 

Author:
Werner Donné

Method Summary
 void compare(InputStream oldVersion, InputStream newVersion, OutputStream out, String mimeType, Context context)
          Calculates the difference between two versions of a resource.
 String resultMimeType(String mimeType)
           
 

Method Detail

compare

void compare(InputStream oldVersion,
             InputStream newVersion,
             OutputStream out,
             String mimeType,
             Context context)
             throws IOException
Calculates the difference between two versions of a resource.

Parameters:
oldVersion - the inputstream for the old version of the resource.
newVersion - the inputstream for the new version of the resource.
out - the stream in which the result with the differences should be written.
mimeType - the MIME type of the resource.
context - the repository context.
Throws:
IOException

resultMimeType

String resultMimeType(String mimeType)
Parameters:
mimeType - the MIME type of the resource.
Returns:
The MIME type of the document that contains the differences. It will be the Content-Type of the response of the GET method when the X-be.re.Compare-With header is present. This is a Pincette extension.