List of usage examples for org.eclipse.jgit.api ApplyResult getUpdatedFiles
public List<File> getUpdatedFiles()
From source file:com.rimerosolutions.ant.git.tasks.ApplyTask.java
License:Apache License
@Override protected void doExecute() { InputStream in = null;//from w w w . j a v a2s. com try { in = new FileInputStream(patchFile); ApplyResult result = git.apply().setPatch(in).call(); Collection<File> updatedFiles = result.getUpdatedFiles(); log("Updated files:" + updatedFiles.size()); if (updatedCountProperty != null) { getProject().setProperty(updatedCountProperty, String.valueOf(updatedFiles.size())); } } catch (PatchFormatException pfe) { throw new GitBuildException("Invalid patch format.", pfe); } catch (PatchApplyException pae) { throw new GitBuildException("Failed to apply patch.", pae); } catch (GitAPIException gae) { throw new GitBuildException("Unexpected runtime error.", gae); } catch (IOException ioe) { throw new GitBuildException("Unexpected IO/Error.", ioe); } finally { if (in != null) { try { in.close(); } catch (IOException ioe) { throw new GitBuildException("Cannot close patch file IO stream.", ioe); } } } }