List of usage examples for org.eclipse.jgit.api ApplyCommand setPatch
public ApplyCommand setPatch(InputStream in)
From source file:org.jboss.maven.plugins.qstools.ArchetypeSyncMojo.java
License:Apache License
/** * Apply a path file to the generated archetype * // ww w .j a v a 2 s . com * @throws IOException * @throws GitAPIException * @throws PatchApplyException * @throws PatchFormatException * * @see {@link ArchetypeSyncMojo#applyPatch} */ private void applyPatch() throws IOException, PatchApplyException { if (this.applyPatch != null) { FileRepositoryBuilder builder = new FileRepositoryBuilder(); Repository repository = builder.findGitDir(new File(baseDir)).build(); Git git = new Git(repository); ApplyCommand applyCommand = git.apply(); applyCommand.setPatch(new FileInputStream(applyPatch)); try { applyCommand.call(); } catch (GitAPIException e) { throw new PatchApplyException("Can't apply " + applyPatch, e); } getLog().info("Patch " + applyPatch + " applied"); } }