From 022e67f05fa65cb02fd5d085734b99a8e3488837 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sun, 10 Aug 2008 01:46:23 -0700 Subject: [PATCH] Expose the current entry's length, last modified in WorkingTreeIterator We need the last modified time available to us in application level code so we can pull the current WorkingTreeIterator from TreeWalk and then grab the last modified time off it to compare against the index file. Signed-off-by: Shawn O. Pearce Signed-off-by: Robin Rosenberg --- .../spearce/jgit/treewalk/WorkingTreeIterator.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/org.spearce.jgit/src/org/spearce/jgit/treewalk/WorkingTreeIterator.java b/org.spearce.jgit/src/org/spearce/jgit/treewalk/WorkingTreeIterator.java index b47da975..31196a89 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/treewalk/WorkingTreeIterator.java +++ b/org.spearce.jgit/src/org/spearce/jgit/treewalk/WorkingTreeIterator.java @@ -259,6 +259,25 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { pathLen = pathOffset + nameLen; } + /** + * Get the byte length of this entry. + * + * @return size of this file, in bytes. + */ + public long getEntryLength() { + return current().getLength(); + } + + /** + * Get the last modified time of this entry. + * + * @return last modified time of this file, in milliseconds since the epoch + * (Jan 1, 1970 UTC). + */ + public long getEntryLastModified() { + return current().getLastModified(); + } + private static final Comparator ENTRY_CMP = new Comparator() { public int compare(final Entry o1, final Entry o2) { final byte[] a = o1.encodedName; -- 2.11.4.GIT