diff options
author | Shawn Pearce <spearce@spearce.org> | 2011-11-03 16:18:43 -0400 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-11-03 16:18:43 -0400 |
commit | c2e828abd63aeedecf3d5e8663c923808ccc047a (patch) | |
tree | 7d19615acecb2f75badd29c01cbf9b98a25e4e94 /org.eclipse.jgit | |
parent | 5041f738e92cc832ae202cccd8a989998a563bd0 (diff) | |
parent | bf81119e62371d743fdae379a642d0857d30bfc0 (diff) | |
download | jgit-c2e828abd63aeedecf3d5e8663c923808ccc047a.tar.gz jgit-c2e828abd63aeedecf3d5e8663c923808ccc047a.zip |
Merge "DirCacheEntry: accessors for cached creation time (CTIME)"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java index defab97a08..2ea79ad6e6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheEntry.java @@ -86,7 +86,7 @@ public class DirCacheEntry { /** The second tree revision (usually called "theirs"). */ public static final int STAGE_3 = 3; - // private static final int P_CTIME = 0; + private static final int P_CTIME = 0; // private static final int P_CTIME_NSEC = 4; @@ -480,6 +480,26 @@ public class DirCacheEntry { } /** + * Get the cached creation time of this file, in milliseconds. + * + * @return cached creation time of this file, in milliseconds since the + * Java epoch (midnight Jan 1, 1970 UTC). + */ + public long getCreationTime() { + return decodeTS(P_CTIME); + } + + /** + * Set the cached creation time of this file, using milliseconds. + * + * @param when + * new cached creation time of the file, in milliseconds. + */ + public void setCreationTime(final long when) { + encodeTS(P_CTIME, when); + } + + /** * Get the cached last modification date of this file, in milliseconds. * <p> * One of the indicators that the file has been modified by an application |