Package org.eclipse.compare.patch
Interface IFilePatch2
- All Known Subinterfaces:
IFilePatch
public interface IFilePatch2
A representation of a file patch that can be applied to an input stream.
- Since:
- org.eclipse.compare.core 3.5
- Restriction:
- This interface is not intended to be implemented by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Special constant that will be returned from get getBeforeDate() or getAfterDate() if the date is unknown. -
Method Summary
Modifier and TypeMethodDescriptionapply
(ReaderCreator content, PatchConfiguration configuration, IProgressMonitor monitor) Apply this patch to the given contents.long
Returns the milliseconds time value of the after date from the patch, or DATE_UNKNOWN if the date is unknown.long
Returns 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 ornull
if there was no header text.IHunk[]
getHunks()
Returns all the hunks this file patch contains.getTargetPath
(PatchConfiguration configuration) Return the target path for this patch.
-
Field Details
-
DATE_UNKNOWN
static 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.- See Also:
-
-
Method Details
-
getTargetPath
Return the target path for this patch. The target path may differ depending on whether the patch is being reversed or not.- Parameters:
configuration
- the patch configuration- Returns:
- the target path for this patch
- See Also:
-
apply
IFilePatchResult apply(ReaderCreator content, PatchConfiguration configuration, IProgressMonitor monitor) Apply this patch to the given contents. The result provides the original and patch contents and also indicates whether some portions of the patch (called hunks) failed to apply.- Parameters:
content
- the contentsconfiguration
- the patch configurationmonitor
- a progress monitor- Returns:
- the result of the patch application
-
getHeader
String getHeader()Return the header information of the patch ornull
if there was no header text. The header may be multi-line.- Returns:
- the header information of the patch or
null
-
getBeforeDate
long getBeforeDate()Returns the milliseconds time value of the before date from the patch, or DATE_UNKNOWN if the date is unknown.- Returns:
- milliseconds time value of the before date from the patch
-
getAfterDate
long getAfterDate()Returns the milliseconds time value of the after date from the patch, or DATE_UNKNOWN if the date is unknown.- Returns:
- milliseconds time value of the after date from the patch
-
getHunks
IHunk[] getHunks()Returns all the hunks this file patch contains.- Returns:
- array of hunks
-