|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.transport.BundleWriter
public class BundleWriter
Creates a Git bundle file, for sneaker-net transport to another system.
Bundles generated by this class can be later read in from a file URI using
the bundle transport, or from an application controlled buffer by the more
generic TransportBundleStream.
Applications creating bundles need to call one or more include
calls to reflect which objects should be available as refs in the bundle for
the other side to fetch. At least one include is required to create a valid
bundle file, and duplicate names are not permitted.
Optional assume calls can be made to declare commits which the
recipient must have in order to fetch from the bundle file. Objects reachable
from these assumed commits can be used as delta bases in order to reduce the
overall bundle size.
| Constructor Summary | |
|---|---|
BundleWriter(Repository repo,
ProgressMonitor monitor)
Create a writer for a bundle. |
|
| Method Summary | |
|---|---|
void |
assume(RevCommit c)
Assume a commit is available on the recipient's side. |
void |
include(Ref r)
Include a single ref (a name/object pair) in the bundle. |
void |
include(java.lang.String name,
AnyObjectId id)
Include an object (and everything reachable from it) in the bundle. |
void |
writeBundle(java.io.OutputStream os)
Generate and write the bundle to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BundleWriter(Repository repo,
ProgressMonitor monitor)
repo - repository where objects are stored.monitor - operations progress monitor.| Method Detail |
|---|
public void include(java.lang.String name,
AnyObjectId id)
name - name the recipient can discover this object as from the
bundle's list of advertised refs . The name must be a valid
ref format and must not have already been included in this
bundle writer.id - object to pack. Multiple refs may point to the same object.public void include(Ref r)
This is a utility function for:
include(r.getName(), r.getObjectId()).
r - the ref to include.public void assume(RevCommit c)
In order to fetch from a bundle the recipient must have any assumed commit. Each assumed commit is explicitly recorded in the bundle header to permit the recipient to validate it has these objects.
c - the commit to assume being available. This commit should be
parsed and not disposed in order to maximize the amount of
debugging information available in the bundle stream.
public void writeBundle(java.io.OutputStream os)
throws java.io.IOException
This method can only be called once per BundleWriter instance.
os - the stream the bundle is written to. If the stream is not
buffered it will be buffered by the writer. Caller is
responsible for closing the stream.
java.io.IOException - an error occurred reading a local object's data to include in
the bundle, or writing compressed object data to the output
stream.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||