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 interface
UnifiedDiffUndoSupportingPatcher.PatcherErrorHandlerFactory
-
Field Summary
Fields Modifier and Type Field Description static String
SERVER_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 void
addListener(PatchListener listener)
void
applyPatch()
Applies patch.void
close()
Disposes the patcher process.Patcher
createUndoPatcher()
void
interrupt()
Interrupts patching process.boolean
needUndoAfterPatchFail()
Do we need to undo patcher changes in case of applying patch fail.void
removeListener(PatchListener listener)
void
setPreserveTimestamp(boolean preserveTimestamp)
void
setPreverseReadonlyAttribute(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:
createUndoPatcher
in interfaceUndoSupportingPatcher
- Throws:
IOException
-
needUndoAfterPatchFail
public boolean needUndoAfterPatchFail()
Do we need to undo patcher changes in case of applying patch fail.- Specified by:
needUndoAfterPatchFail
in interfaceUndoSupportingPatcher
- Since:
- 2019.2
-
applyPatch
public void applyPatch() throws IOException
Description copied from interface:Patcher
Applies patch.- Specified by:
applyPatch
in 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:Patcher
Interrupts patching process.Patcher.applyPatch()
may throw {see jetbrains.buildServer.vcs.patches.InterruptedPatchException}
-
close
public void close()
Description copied from interface:Patcher
Disposes the patcher process.
-
setPreserveTimestamp
public void setPreserveTimestamp(boolean preserveTimestamp)
-
setPreverseReadonlyAttribute
public void setPreverseReadonlyAttribute(boolean preverseReadonlyAttribute)
-
addListener
public void addListener(@NotNull PatchListener listener)
- Specified by:
addListener
in interfacePatcherEventDispatcher
-
removeListener
public void removeListener(@NotNull PatchListener listener)
- Specified by:
removeListener
in interfacePatcherEventDispatcher
-
-