Package org.eclipse.jgit.lib
Class BlobBasedConfig
java.lang.Object
org.eclipse.jgit.lib.Config
org.eclipse.jgit.lib.BlobBasedConfig
Configuration file based on the blobs stored in the repository.
This implementation currently only provides reading support, and is primarily
useful for supporting the
.gitmodules
file.-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jgit.lib.Config
Config.ConfigEnum, Config.SectionParser<T>
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBlobBasedConfig
(Config base, byte[] blob) Parse a configuration from a byte array.BlobBasedConfig
(Config base, Repository db, AnyObjectId objectId) Load a configuration file from a blob.BlobBasedConfig
(Config base, Repository db, AnyObjectId treeish, String path) Load a configuration file from a blob stored in a specific commit. -
Method Summary
Modifier and TypeMethodDescriptionprivate static AnyObjectId
asTree
(ObjectReader or, AnyObjectId treeish) private static byte[]
read
(ObjectReader or, AnyObjectId blobId) private static byte[]
read
(Repository db, AnyObjectId blobId) private static byte[]
read
(Repository db, AnyObjectId treeish, String path) Methods inherited from class org.eclipse.jgit.lib.Config
addChangeListener, clear, escapeSubsection, escapeValue, fireConfigChangedEvent, fromText, get, getBaseConfig, getBoolean, getBoolean, getEnum, getEnum, getInt, getInt, getLong, getLong, getNames, getNames, getNames, getNames, getPath, getRawString, getRefSpecs, getSections, getString, getStringList, getSubsections, getTimeUnit, isMissing, isUtf8, notifyUponTransientChanges, readIncludedConfig, setBoolean, setEnum, setInt, setLong, setString, setStringList, setTypedConfigGetter, toText, uncache, unset, unsetSection
-
Constructor Details
-
BlobBasedConfig
Parse a configuration from a byte array.- Parameters:
base
- the base configuration fileblob
- the byte array, should be UTF-8 encoded text.- Throws:
ConfigInvalidException
- the byte array is not a valid configuration format.
-
BlobBasedConfig
public BlobBasedConfig(Config base, Repository db, AnyObjectId objectId) throws IOException, ConfigInvalidException Load a configuration file from a blob.- Parameters:
base
- the base configuration filedb
- the repositoryobjectId
- the object identifier- Throws:
IOException
- the blob cannot be read from the repository.ConfigInvalidException
- the blob is not a valid configuration format.
-
BlobBasedConfig
public BlobBasedConfig(Config base, Repository db, AnyObjectId treeish, String path) throws FileNotFoundException, IOException, ConfigInvalidException Load a configuration file from a blob stored in a specific commit.- Parameters:
base
- the base configuration filedb
- the repository containing the objects.treeish
- the tree (or commit) that contains the objectpath
- the path within the tree- Throws:
FileNotFoundException
- the path does not exist in the commit's tree.IOException
- the tree and/or blob cannot be accessed.ConfigInvalidException
- the blob is not a valid configuration format.
-
-
Method Details
-
read
private static byte[] read(Repository db, AnyObjectId blobId) throws MissingObjectException, IncorrectObjectTypeException, IOException -
read
private static byte[] read(ObjectReader or, AnyObjectId blobId) throws MissingObjectException, IncorrectObjectTypeException, IOException -
read
private static byte[] read(Repository db, AnyObjectId treeish, String path) throws MissingObjectException, IncorrectObjectTypeException, IOException -
asTree
private static AnyObjectId asTree(ObjectReader or, AnyObjectId treeish) throws MissingObjectException, IncorrectObjectTypeException, IOException
-