Top Description Inners Fields Constructors Methods
org.eclipse.jgit.dircache

public Class DirCache

extends Object
Class Inheritance
Static Imports
java.nio.charset.StandardCharsets.ISO_8859_1

Support for the Git dircache (aka index file).

The index file keeps track of which objects are currently checked out in the working directory, and the last modified time of those working files. Changes in the working directory can be detected by comparing the modification times to the cached modification time within the index file.

Index files are also used during merges, where the merge happens within the index file first, and the working directory is updated as a post-merge step. Conflicts are stored in the index file to allow tool (and human) based resolutions to be easily performed.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static enum
DirCache.DirCacheVersion

DirCache versions

Field Summary

Modifier and TypeField and Description
pack-priv static final Comparator<DirCacheEntry>
private int
entryCnt

Number of positions within sortedEntries that are valid.

private static final int
private IndexChangedListener
indexChangedListener

listener to be informed on commit

private final File
liveFile

Location of the current version of the index file.

private LockFile
myLock

Our active lock (if we hold it); null if we don't have it locked.

private static final byte[]
private static final DirCacheEntry[]
private byte[]
readIndexChecksum

index checksum when index was read from disk

private Repository
repository

Repository containing this index

private static final byte[]
private boolean
skipHash

Whether to skip computing and checking the index checksum

private FileSnapshot
snapshot

Keep track of whether the index has changed or not

private DirCacheEntry[]
sortedEntries

Individual file index entries, sorted by path name.

private DirCacheTree
tree

Cache tree for this index; null if the cache tree is not available.

private DirCache.DirCacheVersion
version

If we read this index from disk, the original format.

private byte[]
writeIndexChecksum

index checksum when index was written to disk

Constructor Summary

AccessConstructor and Description
public
DirCache(File
location of the index file on disk.
indexLocation
,
FS
the file system abstraction which will be necessary to perform certain file system operations.
fs
)

Create a new in-core index representation.

Method Summary

Modifier and TypeMethod and Description
public DirCacheBuilder

Returns:

a new builder instance for this cache.
builder
()

Create a new builder to update this cache.

public void
clear()

Empty this index, removing all entries.

pack-priv static int
pack-priv static int
cmp(byte[] aPath, int aLen, DirCacheEntry b)

pack-priv static int
cmp(final byte[] aPath, final int aLen, final byte[] bPath, final int bLen)

public boolean

Returns:

true if the commit was successful and the file contains the new data; false if the commit failed and the file remains with the old data.
commit
()

Commit this change and release the lock.

public DirCacheEditor

Returns:

a new builder instance for this cache.
editor
()

Create a new editor to recreate this cache.

public int

Returns:

if >= 0 then the return value is the position of the entry in the index; pass to getEntry(int) to obtain the entry information. If < 0 the entry does not exist in the index.
findEntry
(String
the path to search for.
path
)

Locate the position a path's entry is at in the index.

public int

Returns:

if >= 0 then the return value is the position of the entry in the index; pass to getEntry(int) to obtain the entry information. If < 0 the entry does not exist in the index.
findEntry
(byte[]
the byte array starting with the path to search for.
p
,
int
the length of the path in bytes
pLen
)

Locate the position a path's entry is at in the index.

pack-priv int
findEntry(int low, byte[] p, int pLen)

private static String
formatExtensionName(byte[] hdr)

public DirCacheTree

Returns:

the cache tree; null if there is no current cache tree available and build was false.
getCacheTree
(boolean
if true and the cache tree is not present in the index it will be generated and returned to the caller.
build
)

Obtain (or build) the current cache tree structure.

public DirCacheEntry[]

Returns:

all entries recursively contained within the subtree.
getEntriesWithin
(String
the subtree path to get all entries within.
path
)

Recursively get all entries within a subtree.

public DirCacheEntry

Returns:

the entry at position i.
getEntry
(int
position of the entry to get.
i
)

Get a specific entry.

public DirCacheEntry

Returns:

the entry for the given path.
getEntry
(String
the path to search for.
path
)

Get a specific entry.

public int

Returns:

number of entries available.
getEntryCount
()

Total number of file entries stored in the index.

pack-priv DirCache.DirCacheVersion
public boolean

Returns:

true if this index contains unmerged paths. Means: at least one entry is of a stage different from 0. false will be returned if all entries are of stage 0.
hasUnmergedPaths
()

Tells whether this index contains unmerged paths.

private static boolean
is_DIRC(byte[] hdr)

public boolean

Returns:

true if the memory state differs from the index file
isOutdated
()

Whether the memory state differs from the index file

public static DirCache

Returns:

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.
lock
(File
location of the index file on disk.
indexLocation
,
FS
the file system abstraction which will be necessary to perform certain file system operations.
fs
)

Create a new in-core index representation, lock it, and read from disk.

public static DirCache

Returns:

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.
lock
(final Repository
repository containing the index to lock and read
repository
,
final IndexChangedListener
listener to be informed when DirCache is committed
indexChangedListener
)

Create a new in-core index representation, lock it, and read from disk.

public static DirCache

Returns:

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.
lock
(final File
location of the index file on disk.
indexLocation
,
final FS
the file system abstraction which will be necessary to perform certain file system operations.
fs
,
IndexChangedListener
listener to be informed when DirCache is committed
indexChangedListener
)

Create a new in-core index representation, lock it, and read from disk.

public boolean

Returns:

true if the lock is now held by the caller; false if it is held by someone else.
lock
()

Try to establish an update lock on the cache file.

public static DirCache

Returns:

an empty cache which has no backing store file. The cache may not be read or written, but it may be queried and updated (in memory).
newInCore
()

Create a new empty index which is never stored on disk.

private MessageDigest
public int

Returns:

position of the next entry whose path is after the input.
nextEntry
(int
entry position of the path that should be skipped.
position
)

Determine the next index position past all entries with the same name.

pack-priv int
nextEntry(byte[] p, int pLen, int nextIdx)

public static DirCache

Returns:

a new cache which has no backing store file, but contains the contents of treeId.
read
(ObjectReader
reader to access the tree objects from a repository.
reader
,
AnyObjectId
tree to read. Must identify a tree, not a tree-ish.
treeId
)

Create a new in memory index read from the contents of a tree.

public static DirCache

Returns:

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.
read
(Repository
repository containing the index to read
repository
)

Create a new in-core index representation and read an index from disk.

public static DirCache

Returns:

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.
read
(File
location of the index file on disk.
indexLocation
,
FS
the file system abstraction which will be necessary to perform certain file system operations.
fs
)

Create a new in-core index representation and read an index from disk.

public void
read()

Read the index from disk, if it has changed on disk.

private void
private void
private void
pack-priv void
replace(DirCacheEntry[] e, int cnt)

private void
private void
skipOptionalExtension(final InputStream in, final MessageDigest md, final byte[] hdr, long sz)

pack-priv void
toArray(final int i, final DirCacheEntry[] dst, final int off, final int cnt)

public void
unlock()

Unlock this file and abort this change.

private void
updateSmudgedEntries()

Update any smudged entries with information from the working tree.

public void
write()

Write the entry records from memory to disk.

pack-priv void
public ObjectId

Returns:

identity for the root tree.
writeTree
(ObjectInserter
the writer to use when serializing to the store. The caller is responsible for flushing the inserter before trying to use the returned tree identity.
ow
)

Write all index trees to the object store, returning the root tree.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ENT_CMPback to summary
pack-priv static final Comparator<DirCacheEntry> ENT_CMP
entryCntback to summary
private int entryCnt

Number of positions within sortedEntries that are valid.

EXT_TREEback to summary
private static final int EXT_TREE
indexChangedListenerback to summary
private IndexChangedListener indexChangedListener

listener to be informed on commit

liveFileback to summary
private final File liveFile

Location of the current version of the index file.

myLockback to summary
private LockFile myLock

Our active lock (if we hold it); null if we don't have it locked.

NO_CHECKSUMback to summary
private static final byte[] NO_CHECKSUM
NO_ENTRIESback to summary
private static final DirCacheEntry[] NO_ENTRIES
readIndexChecksumback to summary
private byte[] readIndexChecksum

index checksum when index was read from disk

repositoryback to summary
private Repository repository

Repository containing this index

SIG_DIRCback to summary
private static final byte[] SIG_DIRC
skipHashback to summary
private boolean skipHash

Whether to skip computing and checking the index checksum

snapshotback to summary
private FileSnapshot snapshot

Keep track of whether the index has changed or not

sortedEntriesback to summary
private DirCacheEntry[] sortedEntries

Individual file index entries, sorted by path name.

treeback to summary
private DirCacheTree tree

Cache tree for this index; null if the cache tree is not available.

versionback to summary
private DirCache.DirCacheVersion version

If we read this index from disk, the original format.

writeIndexChecksumback to summary
private byte[] writeIndexChecksum

index checksum when index was written to disk

Constructor Detail

DirCacheback to summary
public DirCache(File indexLocation, FS fs)

Create a new in-core index representation.

The new index will be empty. Callers may wish to read from the on disk file first with read().

Parameters
indexLocation:File

location of the index file on disk.

fs:FS

the file system abstraction which will be necessary to perform certain file system operations.

Method Detail

builderback to summary
public DirCacheBuilder builder()

Create a new builder to update this cache.

Callers should add all entries to the builder, then use org.eclipse.jgit.dircache.DirCacheBuilder#finish() to update this instance.

Returns:DirCacheBuilder

a new builder instance for this cache.

clearback to summary
public void clear()

Empty this index, removing all entries.

cmpback to summary
pack-priv static int cmp(DirCacheEntry a, DirCacheEntry b)
cmpback to summary
pack-priv static int cmp(byte[] aPath, int aLen, DirCacheEntry b)
cmpback to summary
pack-priv static int cmp(final byte[] aPath, final int aLen, final byte[] bPath, final int bLen)
commitback to summary
public boolean commit()

Commit this change and release the lock.

If this method fails (returns false) the lock is still released.

Returns:boolean

true if the commit was successful and the file contains the new data; false if the commit failed and the file remains with the old data.

Exceptions
IllegalStateException:
the lock is not held.
editorback to summary
public DirCacheEditor editor()

Create a new editor to recreate this cache.

Callers should add commands to the editor, then use org.eclipse.jgit.dircache.DirCacheEditor#finish() to update this instance.

Returns:DirCacheEditor

a new builder instance for this cache.

findEntryback to summary
public int findEntry(String path)

Locate the position a path's entry is at in the index. For details refer to #findEntry(byte[], int).

Parameters
path:String

the path to search for.

Returns:int

if >= 0 then the return value is the position of the entry in the index; pass to getEntry(int) to obtain the entry information. If < 0 the entry does not exist in the index.

findEntryback to summary
public int findEntry(byte[] p, int pLen)

Locate the position a path's entry is at in the index.

If there is at least one entry in the index for this path the position of the lowest stage is returned. Subsequent stages can be identified by testing consecutive entries until the path differs.

If no path matches the entry -(position+1) is returned, where position is the location it would have gone within the index.

Parameters
p:byte[]

the byte array starting with the path to search for.

pLen:int

the length of the path in bytes

Returns:int

if >= 0 then the return value is the position of the entry in the index; pass to getEntry(int) to obtain the entry information. If < 0 the entry does not exist in the index.

Since
3.4
findEntryback to summary
pack-priv int findEntry(int low, byte[] p, int pLen)
formatExtensionNameback to summary
private static String formatExtensionName(byte[] hdr)
getCacheTreeback to summary
public DirCacheTree getCacheTree(boolean build)

Obtain (or build) the current cache tree structure.

This method can optionally recreate the cache tree, without flushing the tree objects themselves to disk.

Parameters
build:boolean

if true and the cache tree is not present in the index it will be generated and returned to the caller.

Returns:DirCacheTree

the cache tree; null if there is no current cache tree available and build was false.

getEntriesWithinback to summary
public DirCacheEntry[] getEntriesWithin(String path)

Recursively get all entries within a subtree.

Parameters
path:String

the subtree path to get all entries within.

Returns:DirCacheEntry[]

all entries recursively contained within the subtree.

getEntryback to summary
public DirCacheEntry getEntry(int i)

Get a specific entry.

Parameters
i:int

position of the entry to get.

Returns:DirCacheEntry

the entry at position i.

getEntryback to summary
public DirCacheEntry getEntry(String path)

Get a specific entry.

Parameters
path:String

the path to search for.

Returns:DirCacheEntry

the entry for the given path.

getEntryCountback to summary
public int getEntryCount()

Total number of file entries stored in the index.

This count includes unmerged stages for a file entry if the file is currently conflicted in a merge. This means the total number of entries in the index may be up to 3 times larger than the number of files in the working directory.

Note that this value counts only files.

Returns:int

number of entries available.

See Also
getEntry(int)
getVersionback to summary
pack-priv DirCache.DirCacheVersion getVersion()
hasUnmergedPathsback to summary
public boolean hasUnmergedPaths()

Tells whether this index contains unmerged paths.

Returns:boolean

true if this index contains unmerged paths. Means: at least one entry is of a stage different from 0. false will be returned if all entries are of stage 0.

is_DIRCback to summary
private static boolean is_DIRC(byte[] hdr)
isOutdatedback to summary
public boolean isOutdated() throws IOException

Whether the memory state differs from the index file

Returns:boolean

true if the memory state differs from the index file

Exceptions
IOException:
if an IO error occurred
lockback to summary
public static DirCache lock(File indexLocation, FS fs) throws CorruptObjectException, IOException

Create a new in-core index representation, lock it, and read from disk.

The new index will be locked and then read before it is returned to the caller. Read failures are reported as exceptions and therefore prevent the method from returning a partially populated index. On read failure, the lock is released.

Parameters
indexLocation:File

location of the index file on disk.

fs:FS

the file system abstraction which will be necessary to perform certain file system operations.

Returns:DirCache

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.

Exceptions
CorruptObjectException:
the index file is using a format or extension that this library does not support.
IOException:
the index file is present but could not be read, or the lock could not be obtained.
lockback to summary
public static DirCache lock(final Repository repository, final IndexChangedListener indexChangedListener) throws CorruptObjectException, IOException

Create a new in-core index representation, lock it, and read from disk.

The new index will be locked and then read before it is returned to the caller. Read failures are reported as exceptions and therefore prevent the method from returning a partially populated index. On read failure, the lock is released.

Parameters
repository:Repository

repository containing the index to lock and read

indexChangedListener:IndexChangedListener

listener to be informed when DirCache is committed

Returns:DirCache

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.

Exceptions
CorruptObjectException:
the index file is using a format or extension that this library does not support.
IOException:
the index file is present but could not be read, or the lock could not be obtained.
Since
2.0
lockback to summary
public static DirCache lock(final File indexLocation, final FS fs, IndexChangedListener indexChangedListener) throws CorruptObjectException, IOException

Create a new in-core index representation, lock it, and read from disk.

The new index will be locked and then read before it is returned to the caller. Read failures are reported as exceptions and therefore prevent the method from returning a partially populated index. On read failure, the lock is released.

Parameters
indexLocation:File

location of the index file on disk.

fs:FS

the file system abstraction which will be necessary to perform certain file system operations.

indexChangedListener:IndexChangedListener

listener to be informed when DirCache is committed

Returns:DirCache

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.

Exceptions
CorruptObjectException:
the index file is using a format or extension that this library does not support.
IOException:
the index file is present but could not be read, or the lock could not be obtained.
lockback to summary
public boolean lock() throws IOException

Try to establish an update lock on the cache file.

Returns:boolean

true if the lock is now held by the caller; false if it is held by someone else.

Exceptions
IOException:
the output file could not be created. The caller does not hold the lock.
newInCoreback to summary
public static DirCache newInCore()

Create a new empty index which is never stored on disk.

Returns:DirCache

an empty cache which has no backing store file. The cache may not be read or written, but it may be queried and updated (in memory).

newMessageDigestback to summary
private MessageDigest newMessageDigest()
nextEntryback to summary
public int nextEntry(int position)

Determine the next index position past all entries with the same name.

As index entries are sorted by path name, then stage number, this method advances the supplied position to the first position in the index whose path name does not match the path name of the supplied position's entry.

Parameters
position:int

entry position of the path that should be skipped.

Returns:int

position of the next entry whose path is after the input.

nextEntryback to summary
pack-priv int nextEntry(byte[] p, int pLen, int nextIdx)
readback to summary
public static DirCache read(ObjectReader reader, AnyObjectId treeId) throws IOException

Create a new in memory index read from the contents of a tree.

Parameters
reader:ObjectReader

reader to access the tree objects from a repository.

treeId:AnyObjectId

tree to read. Must identify a tree, not a tree-ish.

Returns:DirCache

a new cache which has no backing store file, but contains the contents of treeId.

Exceptions
IOException:
one or more trees not available from the ObjectReader.
Since
4.2
readback to summary
public static DirCache read(Repository repository) throws CorruptObjectException, IOException

Create a new in-core index representation and read an index from disk.

The new index will be read before it is returned to the caller. Read failures are reported as exceptions and therefore prevent the method from returning a partially populated index.

Parameters
repository:Repository

repository containing the index to read

Returns:DirCache

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.

Exceptions
CorruptObjectException:
the index file is using a format or extension that this library does not support.
IOException:
the index file is present but could not be read.
readback to summary
public static DirCache read(File indexLocation, FS fs) throws CorruptObjectException, IOException

Create a new in-core index representation and read an index from disk.

The new index will be read before it is returned to the caller. Read failures are reported as exceptions and therefore prevent the method from returning a partially populated index.

Parameters
indexLocation:File

location of the index file on disk.

fs:FS

the file system abstraction which will be necessary to perform certain file system operations.

Returns:DirCache

a cache representing the contents of the specified index file (if it exists) or an empty cache if the file does not exist.

Exceptions
CorruptObjectException:
the index file is using a format or extension that this library does not support.
IOException:
the index file is present but could not be read.
readback to summary
public void read() throws IOException, CorruptObjectException

Read the index from disk, if it has changed on disk.

This method tries to avoid loading the index if it has not changed since the last time we consulted it. A missing index file will be treated as though it were present but had no file entries in it.

Exceptions
IOException:
the index file is present but could not be read. This DirCache instance may not be populated correctly.
CorruptObjectException:
the index file is using a format or extension that this library does not support.
readConfigback to summary
private void readConfig()
readFromback to summary
private void readFrom(InputStream inStream) throws IOException, CorruptObjectException
registerIndexChangedListenerback to summary
private void registerIndexChangedListener(IndexChangedListener listener)
replaceback to summary
pack-priv void replace(DirCacheEntry[] e, int cnt)
requireLockedback to summary
private void requireLocked(LockFile tmp)
skipOptionalExtensionback to summary
private void skipOptionalExtension(final InputStream in, final MessageDigest md, final byte[] hdr, long sz) throws IOException
toArrayback to summary
pack-priv void toArray(final int i, final DirCacheEntry[] dst, final int off, final int cnt)
unlockback to summary
public void unlock()

Unlock this file and abort this change.

The temporary file (if created) is deleted before returning.

updateSmudgedEntriesback to summary
private void updateSmudgedEntries() throws IOException

Update any smudged entries with information from the working tree.

Exceptions
IOException:
if an IO error occurred
writeback to summary
public void write() throws IOException

Write the entry records from memory to disk.

The cache must be locked first by calling lock() and receiving true as the return value. Applications are encouraged to lock the index, then invoke read() to ensure the in-memory data is current, prior to updating the in-memory entries.

Once written the lock is closed and must be either committed with commit() or rolled back with unlock().

Exceptions
IOException:
the output file could not be created. The caller no longer holds the lock.
writeToback to summary
pack-priv void writeTo(File dir, OutputStream os) throws IOException
writeTreeback to summary
public ObjectId writeTree(ObjectInserter ow) throws UnmergedPathException, IOException

Write all index trees to the object store, returning the root tree.

Parameters
ow:ObjectInserter

the writer to use when serializing to the store. The caller is responsible for flushing the inserter before trying to use the returned tree identity.

Returns:ObjectId

identity for the root tree.

Exceptions
UnmergedPathException:
one or more paths contain higher-order stages (stage > 0), which cannot be stored in a tree object.
IOException:
an unexpected error occurred writing to the object store.
IllegalStateException:
one or more paths contain an invalid mode which should never appear in a tree object.
org.eclipse.jgit.dircache back to summary

private Class DirCache.DirCacheConfig

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final DirCache.DirCacheVersion
private final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public DirCache.DirCacheVersion
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

indexVersionback to summary
private final DirCache.DirCacheVersion indexVersion
skipHashback to summary
private final boolean skipHash

Constructor Detail

DirCacheConfigback to summary
public DirCacheConfig(Config cfg)

Method Detail

getIndexVersionback to summary
public DirCache.DirCacheVersion getIndexVersion()
isSkipHashback to summary
public boolean isSkipHash()
org.eclipse.jgit.dircache back to summary

public final Enum DirCache.DirCacheVersion

extends Enum<DirCache.DirCacheVersion>
implements ConfigEnum
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.lib.Config.ConfigEnum

DirCache versions
Since
7.2

Field Summary

Modifier and TypeField and Description
public static final DirCache.DirCacheVersion
DIRC_VERSION_EXTENDED

Version 3 supports extended flags.

public static final DirCache.DirCacheVersion
DIRC_VERSION_MINIMUM

Minimum index version on-disk format that we support.

public static final DirCache.DirCacheVersion
DIRC_VERSION_PATHCOMPRESS

Version 4 adds very simple "path compression": it strips out the common prefix between the last entry written and the current entry.

private final int

Constructor Summary

AccessConstructor and Description
private
DirCacheVersion(int versionCode)

Method Summary

Modifier and TypeMethod and Description
public static DirCache.DirCacheVersion

Returns:

the DirCacheVersion instance of the version code.
fromInt
(int
integer value of the version code.
val
)

Create DirCacheVersion from integer value of the version code.

public int

Returns:

the version code for this version
getVersionCode
()

public boolean
matchConfigValue(String
the string to match
in
)

Implements org.eclipse.jgit.lib.Config.ConfigEnum.matchConfigValue.

Checks if the given string matches with enum value.

public String
toConfigValue()

Implements org.eclipse.jgit.lib.Config.ConfigEnum.toConfigValue.

Converts enumeration value into a string to be save in config.

public static DirCache.DirCacheVersion
public static DirCache.DirCacheVersion[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DIRC_VERSION_EXTENDEDback to summary
public static final DirCache.DirCacheVersion DIRC_VERSION_EXTENDED

Version 3 supports extended flags.

DIRC_VERSION_MINIMUMback to summary
public static final DirCache.DirCacheVersion DIRC_VERSION_MINIMUM

Minimum index version on-disk format that we support.

DIRC_VERSION_PATHCOMPRESSback to summary
public static final DirCache.DirCacheVersion DIRC_VERSION_PATHCOMPRESS

Version 4 adds very simple "path compression": it strips out the common prefix between the last entry written and the current entry. Instead of writing two entries with paths "foo/bar/baz/a.txt" and "foo/bar/baz/b.txt" it only writes "b.txt" for the second entry.

It is also not padded.

versionback to summary
private final int version

Constructor Detail

DirCacheVersionback to summary
private DirCacheVersion(int versionCode)

Method Detail

fromIntback to summary
public static DirCache.DirCacheVersion fromInt(int val)

Create DirCacheVersion from integer value of the version code.

Parameters
val:int

integer value of the version code.

Returns:DirCache.DirCacheVersion

the DirCacheVersion instance of the version code.

getVersionCodeback to summary
public int getVersionCode()
Returns:int

the version code for this version

matchConfigValueback to summary
public boolean matchConfigValue(String in)

Implements org.eclipse.jgit.lib.Config.ConfigEnum.matchConfigValue.

Doc from org.eclipse.jgit.lib.Config.ConfigEnum.matchConfigValue.

Checks if the given string matches with enum value.

Parameters
in:String

the string to match

Returns:boolean

true if the given string matches enum value, false otherwise

Annotations
@Override
toConfigValueback to summary
public String toConfigValue()

Implements org.eclipse.jgit.lib.Config.ConfigEnum.toConfigValue.

Doc from org.eclipse.jgit.lib.Config.ConfigEnum.toConfigValue.

Converts enumeration value into a string to be save in config.

Returns:String

the enum value as config string

Annotations
@Override
valueOfback to summary
public static DirCache.DirCacheVersion valueOf(String name)
valuesback to summary
public static DirCache.DirCacheVersion[] values()