public class BlobBasedConfig extends Config
.gitmodules
file.Config.ConfigEnum, Config.SectionParser<T>
Constructor and Description |
---|
BlobBasedConfig(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,
java.lang.String path)
Load a configuration file from a blob stored in a specific commit.
|
Modifier and Type | Method and Description |
---|---|
private 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,
java.lang.String path) |
addChangeListener, clear, escapeSubsection, escapeValue, fireConfigChangedEvent, fromText, get, getBaseConfig, getBoolean, getBoolean, getEnum, getEnum, getInt, getInt, getLong, getLong, getNames, getNames, getNames, getNames, getRawString, getRefSpecs, getSections, getString, getStringList, getSubsections, getTimeUnit, isMissing, isUtf8, notifyUponTransientChanges, readIncludedConfig, setBoolean, setEnum, setInt, setLong, setString, setStringList, setTypedConfigGetter, toText, uncache, unset, unsetSection
public BlobBasedConfig(Config base, byte[] blob) throws ConfigInvalidException
base
- the base configuration fileblob
- the byte array, should be UTF-8 encoded text.ConfigInvalidException
- the byte array is not a valid configuration format.public BlobBasedConfig(Config base, Repository db, AnyObjectId objectId) throws java.io.IOException, ConfigInvalidException
base
- the base configuration filedb
- the repositoryobjectId
- the object identifierjava.io.IOException
- the blob cannot be read from the repository.ConfigInvalidException
- the blob is not a valid configuration format.public BlobBasedConfig(Config base, Repository db, AnyObjectId treeish, java.lang.String path) throws java.io.FileNotFoundException, java.io.IOException, ConfigInvalidException
base
- the base configuration filedb
- the repository containing the objects.treeish
- the tree (or commit) that contains the objectpath
- the path within the treejava.io.FileNotFoundException
- the path does not exist in the commit's tree.java.io.IOException
- the tree and/or blob cannot be accessed.ConfigInvalidException
- the blob is not a valid configuration format.private static byte[] read(Repository db, AnyObjectId blobId) throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
MissingObjectException
IncorrectObjectTypeException
java.io.IOException
private static byte[] read(ObjectReader or, AnyObjectId blobId) throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
MissingObjectException
IncorrectObjectTypeException
java.io.IOException
private static byte[] read(Repository db, AnyObjectId treeish, java.lang.String path) throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
MissingObjectException
IncorrectObjectTypeException
java.io.IOException
private static AnyObjectId asTree(ObjectReader or, AnyObjectId treeish) throws MissingObjectException, IncorrectObjectTypeException, java.io.IOException
MissingObjectException
IncorrectObjectTypeException
java.io.IOException