|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.lib.ObjectDatabase
org.eclipse.jgit.lib.ObjectDirectory
public class ObjectDirectory
Traditional file system based ObjectDatabase.
This is the classical object database representation for a Git repository,
where objects are stored loose by hashing them into directories by their
ObjectId, or are stored in compressed containers known as
PackFiles.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jgit.lib.ObjectDatabase |
|---|
NO_ALTERNATES |
| Constructor Summary | |
|---|---|
ObjectDirectory(java.io.File dir)
Initialize a reference to an on-disk object directory. |
|
| Method Summary | |
|---|---|
void |
closeSelf()
Close any resources held by this database only; ignoring alternates. |
void |
create()
Initialize a new object database at this location. |
boolean |
exists()
Does this database exist yet? |
java.io.File |
fileFor(AnyObjectId objectId)
Compute the location of a loose object file. |
java.io.File |
getDirectory()
|
protected boolean |
hasObject1(AnyObjectId objectId)
Fast half of ObjectDatabase.hasObject(AnyObjectId). |
protected boolean |
hasObject2(java.lang.String objectName)
Slow half of ObjectDatabase.hasObject(AnyObjectId). |
protected ObjectDatabase[] |
loadAlternates()
Load the list of alternate databases into memory. |
protected ObjectLoader |
openObject1(WindowCursor curs,
AnyObjectId objectId)
Fast half of ObjectDatabase.openObject(WindowCursor, AnyObjectId). |
protected ObjectLoader |
openObject2(WindowCursor curs,
java.lang.String objectName,
AnyObjectId objectId)
Slow half of ObjectDatabase.openObject(WindowCursor, AnyObjectId). |
void |
openPack(java.io.File pack,
java.io.File idx)
Add a single existing pack to the list of available pack files. |
java.lang.String |
toString()
|
protected boolean |
tryAgain1()
|
| Methods inherited from class org.eclipse.jgit.lib.ObjectDatabase |
|---|
close, closeAlternates, closeAlternates, getAlternates, hasObject, openObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectDirectory(java.io.File dir)
dir - the location of the objects directory.| Method Detail |
|---|
public final java.io.File getDirectory()
objects directory.public boolean exists()
ObjectDatabase
exists in class ObjectDatabaseObjectDatabase.create() to create this database location.
public void create()
throws java.io.IOException
ObjectDatabase
create in class ObjectDatabasejava.io.IOException - the database could not be created.public void closeSelf()
ObjectDatabase
To fully close this database and its referenced alternates, the caller
should instead invoke ObjectDatabase.close().
closeSelf in class ObjectDatabasepublic java.io.File fileFor(AnyObjectId objectId)
objectId - identity of the loose object to map to the directory.
public void openPack(java.io.File pack,
java.io.File idx)
throws java.io.IOException
pack - path of the pack file to open.idx - path of the corresponding index file.
java.io.IOException - index file could not be opened, read, or is not recognized as
a Git pack file index.public java.lang.String toString()
toString in class java.lang.Objectprotected boolean hasObject1(AnyObjectId objectId)
ObjectDatabaseObjectDatabase.hasObject(AnyObjectId).
hasObject1 in class ObjectDatabaseobjectId - identity of the object to test for existence of.
protected ObjectLoader openObject1(WindowCursor curs,
AnyObjectId objectId)
throws java.io.IOException
ObjectDatabaseObjectDatabase.openObject(WindowCursor, AnyObjectId).
openObject1 in class ObjectDatabasecurs - temporary working space associated with the calling thread.objectId - identity of the object to open.
ObjectLoader for accessing the data of the named
object, or null if the object does not exist.
java.io.IOExceptionprotected boolean hasObject2(java.lang.String objectName)
ObjectDatabaseObjectDatabase.hasObject(AnyObjectId).
hasObject2 in class ObjectDatabaseobjectName - identity of the object to test for existence of.
protected ObjectLoader openObject2(WindowCursor curs,
java.lang.String objectName,
AnyObjectId objectId)
throws java.io.IOException
ObjectDatabaseObjectDatabase.openObject(WindowCursor, AnyObjectId).
openObject2 in class ObjectDatabasecurs - temporary working space associated with the calling thread.objectName - name of the object to open.objectId - identity of the object to open.
ObjectLoader for accessing the data of the named
object, or null if the object does not exist.
java.io.IOExceptionprotected boolean tryAgain1()
tryAgain1 in class ObjectDatabase
protected ObjectDatabase[] loadAlternates()
throws java.io.IOException
ObjectDatabase
This method is invoked by ObjectDatabase.getAlternates() if the alternate list
has not yet been populated, or if ObjectDatabase.closeAlternates() has been
called on this instance and the alternate list is needed again.
If the alternate array is empty, implementors should consider using the
constant ObjectDatabase.NO_ALTERNATES.
loadAlternates in class ObjectDatabasejava.io.IOException - the alternate list could not be accessed. The empty alternate
array ObjectDatabase.NO_ALTERNATES will be assumed by the caller.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||