org.netbeans.lib.cvsclient.file
Class WriteRcsDiffFilePreprocessor

java.lang.Object
  extended by org.netbeans.lib.cvsclient.file.WriteRcsDiffFilePreprocessor
All Implemented Interfaces:
WriteTextFilePreprocessor

public class WriteRcsDiffFilePreprocessor
extends java.lang.Object
implements WriteTextFilePreprocessor

File Processor that handles processing of rcs-diff response. (aka diff -n format) The original file is read and a merge is created. At the same time the correct line-ending is processed. It's possible to set the processor the preffered line-ending. The default is dependant on the platform.


Constructor Summary
WriteRcsDiffFilePreprocessor()
           
 
Method Summary
 void copyTextFileToLocation(java.io.InputStream processedInput, java.io.File fileToWrite, OutputStreamProvider customOutput)
          Processes the diff and merges it with the original file.
 java.lang.String getLineEnding()
          Gets the value of lineending used when writing the resulting file.
 void setLineEnding(java.lang.String lineEnding)
          Setter for lineEnding used to write the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteRcsDiffFilePreprocessor

public WriteRcsDiffFilePreprocessor()
Method Detail

getLineEnding

public java.lang.String getLineEnding()
Gets the value of lineending used when writing the resulting file.

Returns:
Value of property lineEnding.

setLineEnding

public void setLineEnding(java.lang.String lineEnding)
Setter for lineEnding used to write the file.

Parameters:
lineEnding - New value of property lineEnding.

copyTextFileToLocation

public void copyTextFileToLocation(java.io.InputStream processedInput,
                                   java.io.File fileToWrite,
                                   OutputStreamProvider customOutput)
                            throws java.io.IOException
Processes the diff and merges it with the original file.

Specified by:
copyTextFileToLocation in interface WriteTextFilePreprocessor
Parameters:
processedInput - the stored diff.
fileToWrite - the resulting file and the original that is merged as the same time.
customOutput -
Throws:
java.io.IOException - if any IO operation fails. The original file is replaced by the merge only if no excpetion is thrown.

 

Built on October 26 2010.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.