| Type | Name and description |
|---|---|
static java.nio.charset.Charset |
DEFAULT_CHARSETThe default character set, UTF-8. |
static java.lang.String |
DEFAULT_DIFF_EXTENSIONThe patching logic looks for files with the .diff
extension by default. |
org.slf4j.Logger |
log |
| Constructor and description |
|---|
Patcher
(org.slf4j.Logger log) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
apply(java.io.File patch, java.io.File content, java.io.File destination)Applies the parameter patch(es) to the parameter file(s). |
|
java.util.List<java.lang.String> |
apply(java.io.File patchOrPatches, java.io.File fileOrFiles, java.lang.String diffExtension, java.nio.charset.Charset charset, java.io.File destinationDir)Applies one or more patches to one or more files. |
|
java.util.List<java.lang.String> |
applyDirectory(java.io.File patchDir, java.io.File contentDir, java.lang.String diffExtension, java.nio.charset.Charset charset, java.io.File destinationDir)Applies a directory of patches to a directory of content. |
|
java.util.List<java.lang.String> |
applyFile(java.io.File patchFile, java.io.File contentFile, java.nio.charset.Charset charset, java.io.File destinationFile, java.util.List<java.lang.String> errors)Applies a patch file to a content file. |
|
java.io.File |
applyOrThrow(java.io.File patchFile, java.io.File contentFile, java.io.File destinationFile)Applies a patch file to a content file. |
|
java.io.File |
applyOrThrow(java.io.File patchFile, java.io.File contentFile, java.nio.charset.Charset charset, java.io.File destinationFile)Applies a patch file to a content file and produces a destination file. |
|
java.util.List<java.lang.String> |
applyOrThrow(java.util.List<java.lang.String> patchLines, java.util.List<java.lang.String> contentLines) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The default character set, UTF-8.
The patching logic looks for files with the .diff
extension by default.
Applies the parameter patch(es) to the parameter file(s).
patch - The patch file to applycontent - The content to apply the patch todestination - The destination to write toApplies one or more patches to one or more files.
If no patch or patch directory is provided, nothing is done.
If an empty patch directory is provided, everything under the content directory will be copied to the destination directory without modification.
If a patch directory with a set of patches that match some of the files in the content directory is provided, then the patches will be applied, and the remaining files will be copied without modification.
patchOrPatches - A patch file or directory containing patch filesfileOrFiles - A content file or directory containing content filesdiffExtension - The file extension that identifies the patch filescharset - The character set in use, defaults to UTF-8destinatinDir - The directory to write toApplies a directory of patches to a directory of content.
patchDir - A directory containing patch filescontentDir - A content directorydiffExtension - The file extension that identifies the patch filescharset - The character set in use, defaults to UTF-8destinationDir - The directory to write toApplies a patch file to a content file.
patchFile - A patch filecontentFile - A content filecharset - The character set in use, defaults to UTF-8destinationFile - The file to write toerrors - An error list to add to if patching failsApplies a patch file to a content file.
patchFile - A patch filecontentFile - A content filedestinationFile - The file to write toApplies a patch file to a content file and produces a destination file.
patchFile - A patch filecontentFile - A content filecharset - The character set in use, defaults to UTF-8destinationFile - The output file to write toGroovy Documentation