Package org.eclipse.compare.patch
Interface IFilePatch
- All Superinterfaces:
- IFilePatch2
A representation of a file patch that can be applied to an input stream.
- Since:
- 3.3
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
              Clients can obtain file patches by calling
              ApplyPatchOperation.parsePatch(org.eclipse.core.resources.IStorage).
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final longSpecial constant that will be returned from get getBeforeDate() or getAfterDate() if the date is unknown.
- 
Method SummaryModifier and TypeMethodDescriptionapply(IStorage contents, PatchConfiguration configuration, IProgressMonitor monitor) Apply this patch to the given file contents.longReturns the milliseconds time value of the after date from the patch, or DATE_UNKNOWN if the date is unknown.longReturns the milliseconds time value of the before date from the patch, or DATE_UNKNOWN if the date is unknown.Return the header information of the patch ornullif there was no header text.getTargetPath(PatchConfiguration configuration) Return the target path for this patch.Methods inherited from interface org.eclipse.compare.patch.IFilePatch2apply, getHunks
- 
Field Details- 
DATE_UNKNOWNstatic final long DATE_UNKNOWNSpecial constant that will be returned from get getBeforeDate() or getAfterDate() if the date is unknown. Equal to Midnight, Jan 1, 1970 GMT.- Since:
- 3.4
- See Also:
 
 
- 
- 
Method Details- 
getTargetPathReturn the target path for this patch. The target path may differ depending on whether the patch is being reversed or not.- Specified by:
- getTargetPathin interface- IFilePatch2
- Parameters:
- configuration- the patch configuration
- Returns:
- the target path for this patch
- See Also:
 
- 
applyIFilePatchResult apply(IStorage contents, PatchConfiguration configuration, IProgressMonitor monitor) Apply this patch to the given file contents. The result provides the original and patch contents and also indicates whether some portions of the patch (called hunks) failed to apply.- Parameters:
- contents- the file contents
- configuration- the patch configuration
- monitor- a progress monitor
- Returns:
- the result of the patch application
 
- 
getHeaderString getHeader()Return the header information of the patch ornullif there was no header text. The header may be multi-line.- Specified by:
- getHeaderin interface- IFilePatch2
- Returns:
- the header information of the patch or
 null
 
- 
getBeforeDatelong getBeforeDate()Returns the milliseconds time value of the before date from the patch, or DATE_UNKNOWN if the date is unknown.- Specified by:
- getBeforeDatein interface- IFilePatch2
- Returns:
- milliseconds time value of the before date from the patch
- Since:
- 3.4
 
- 
getAfterDatelong getAfterDate()Returns the milliseconds time value of the after date from the patch, or DATE_UNKNOWN if the date is unknown.- Specified by:
- getAfterDatein interface- IFilePatch2
- Returns:
- milliseconds time value of the after date from the patch
- Since:
- 3.4
 
 
-