Merge "DirCacheEntry: accessors for cached creation time (CTIME)"

This commit is contained in:
Shawn Pearce 2011-11-03 16:18:43 -04:00 committed by Code Review
commit c2e828abd6
1 changed files with 21 additions and 1 deletions

View File

@ -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;
@ -479,6 +479,26 @@ public void setFileMode(final FileMode mode) {
NB.encodeInt32(info, infoOffset + P_MODE, mode.getBits());
}
/**
* 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>