List of usage examples for org.eclipse.jgit.api ApplyCommand call
@Override public ApplyResult call() throws GitAPIException, PatchFormatException, PatchApplyException
Executes the ApplyCommand command with all the options and parameters collected by the setter methods (e.g.
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 va 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"); } }