org.eclipse.jgit.lib
Class BlobBasedConfig

java.lang.Object
  extended by org.eclipse.jgit.lib.Config
      extended by org.eclipse.jgit.lib.BlobBasedConfig

public class BlobBasedConfig
extends Config

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.SectionParser<T>
 
Constructor Summary
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, String path)
          Load a configuration file from a blob stored in a specific commit.
 
Method Summary
 
Methods inherited from class org.eclipse.jgit.lib.Config
addChangeListener, clear, fireConfigChangedEvent, fromText, get, getBoolean, getBoolean, getEnum, getEnum, getInt, getInt, getLong, getLong, getNames, getNames, getSections, getString, getStringList, getSubsections, notifyUponTransientChanges, setBoolean, setEnum, setInt, setLong, setString, setStringList, toText, uncache, unset, unsetSection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlobBasedConfig

public BlobBasedConfig(Config base,
                       byte[] blob)
                throws ConfigInvalidException
Parse a configuration from a byte array.

Parameters:
base - the base configuration file
blob - 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 file
db - the repository
objectId - 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 file
db - the repository containing the objects.
treeish - the tree (or commit) that contains the object
path - 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.


Copyright © 2012. All Rights Reserved.