| 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) |
|
protected void |
copy(java.io.File file, java.io.File toFile) |
|
protected java.util.List<java.lang.String> |
getLines(java.lang.String inputPath)Returns the lines of the file at the input path. |
|
protected java.util.List<java.lang.String> |
getLines(java.io.File inputFile)Returns the lines of the parameter file. |
|
protected java.io.File |
writeLines(java.util.List<java.lang.String> patchedLines, java.lang.String outputPath, java.nio.charset.Charset charset) |
|
protected java.io.File |
writeLines(java.util.List<java.lang.String> patchedLines, java.io.File outputFile, java.nio.charset.Charset charset) |
| 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.
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 toReturns the lines of the file at the input path.
inputPath - The input path to read fromReturns the lines of the parameter file.
inputFile - The input file to read fromGroovy Documentation