Class UnifiedDiffUndoSupportingPatcher
- java.lang.Object
-
- jetbrains.buildServer.vcs.patches.UnifiedDiffUndoSupportingPatcher
-
- All Implemented Interfaces:
Patcher,PatcherEventDispatcher,UndoSupportingPatcher
public class UnifiedDiffUndoSupportingPatcher extends Object implements UndoSupportingPatcher, PatcherEventDispatcher
Patcher for unified diff patch format and supports undo patching.- Since:
- 2019.1
- Author:
- Mikhail Khorkov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceUnifiedDiffUndoSupportingPatcher.PatcherErrorHandlerFactory
-
Field Summary
Fields Modifier and Type Field Description static StringSERVER_FAIL_PATCH_CLUE
-
Constructor Summary
Constructors Constructor Description UnifiedDiffUndoSupportingPatcher(File patch, File undoPatchTmp, File workingDirectory, UnifiedDiffUndoSupportingPatcher.PatcherErrorHandlerFactory errorHandler, Closeable undoClosableResource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(PatchListener listener)voidapplyPatch()Applies patch.voidclose()Disposes the patcher process.PatchercreateUndoPatcher()voidinterrupt()Interrupts patching process.booleanneedUndoAfterPatchFail()Do we need to undo patcher changes in case of applying patch fail.voidremoveListener(PatchListener listener)voidsetPreserveTimestamp(boolean preserveTimestamp)voidsetPreverseReadonlyAttribute(boolean preverseReadonlyAttribute)
-
-
-
Field Detail
-
SERVER_FAIL_PATCH_CLUE
public static final String SERVER_FAIL_PATCH_CLUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnifiedDiffUndoSupportingPatcher
public UnifiedDiffUndoSupportingPatcher(@NotNull File patch, @NotNull File undoPatchTmp, @NotNull File workingDirectory, @NotNull UnifiedDiffUndoSupportingPatcher.PatcherErrorHandlerFactory errorHandler, @NotNull Closeable undoClosableResource) throws IOException- Throws:
IOException
-
-
Method Detail
-
createUndoPatcher
@NotNull public Patcher createUndoPatcher() throws IOException
- Specified by:
createUndoPatcherin interfaceUndoSupportingPatcher- Throws:
IOException
-
needUndoAfterPatchFail
public boolean needUndoAfterPatchFail()
Do we need to undo patcher changes in case of applying patch fail.- Specified by:
needUndoAfterPatchFailin interfaceUndoSupportingPatcher- Since:
- 2019.2
-
applyPatch
public void applyPatch() throws IOExceptionDescription copied from interface:PatcherApplies patch.- Specified by:
applyPatchin interfacePatcher- Throws:
IOException- some file system operation failed or patch process terminated with see jetbrains.buildServer.vcs.patches.InterruptedPatchException or some problem occurred during the patch process (see jetbrains.buildServer.vcs.patches.UnsuccessfulPatchException).
-
interrupt
public void interrupt()
Description copied from interface:PatcherInterrupts patching process.Patcher.applyPatch()may throw {see jetbrains.buildServer.vcs.patches.InterruptedPatchException}
-
close
public void close()
Description copied from interface:PatcherDisposes the patcher process.
-
setPreserveTimestamp
public void setPreserveTimestamp(boolean preserveTimestamp)
-
setPreverseReadonlyAttribute
public void setPreverseReadonlyAttribute(boolean preverseReadonlyAttribute)
-
addListener
public void addListener(@NotNull PatchListener listener)- Specified by:
addListenerin interfacePatcherEventDispatcher
-
removeListener
public void removeListener(@NotNull PatchListener listener)- Specified by:
removeListenerin interfacePatcherEventDispatcher
-
-