Top Description Fields Constructors Methods
org.eclipse.jgit.transport

public Class TransportBundleStream

extends Transport
implements TransportBundle
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.transport.TransportBundle, org.eclipse.jgit.transport.PackTransport
Imports
java.io.IOException, .InputStream, org.eclipse.jgit.errors.NotSupportedException, .TransportException, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.Repository

Single shot fetch from a streamed Git bundle.

The bundle is read from an unbuffered input stream, which limits the transport to opening at most one FetchConnection before needing to recreate the transport instance.

Field Summary

Modifier and TypeField and Description
private InputStream
Inherited from org.eclipse.jgit.transport.Transport:
DEFAULT_FETCH_THINDEFAULT_PUSH_THINDEFAULT_PUSH_USE_BITMAPSlocalprotocolREFSPEC_PUSH_ALLREFSPEC_TAGSuri

Constructor Summary

AccessConstructor and Description
public
TransportBundleStream(final Repository
repository the fetched objects will be loaded into.
db
,
final URIish
symbolic name of the source of the stream. The URI can reference a non-existent resource. It is used only for exception reporting.
uri
,
final InputStream
the stream to read the bundle from.
in
)

Create a new transport to fetch objects from a streamed bundle.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract org.eclipse.jgit.transport.Transport.close.

Implements java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources.

public FetchConnection
openFetch()

Implements abstract org.eclipse.jgit.transport.Transport.openFetch.

Begins a new connection for fetching from the remote repository.

public PushConnection
openPush()

Implements abstract org.eclipse.jgit.transport.Transport.openPush.

Begins a new connection for pushing into the remote repository.

Inherited from org.eclipse.jgit.transport.Transport:
applyConfigfetchfetchfindRemoteRefUpdatesForfindRemoteRefUpdatesForfindRemoteRefUpdatesForfindRemoteRefUpdatesForfindTrackingRefNamegetCredentialsProvidergetDeepenNotsgetDeepenSincegetDepthgetFilterSpecgetObjectCheckergetOptionReceivePackgetOptionUploadPackgetPackConfiggetPushOptionsgetTagOptgetTimeoutgetTransportProtocolsgetURIisCheckFetchedObjectsisDryRunisFetchThinisPushAtomicisPushThinisPushUseBitmapsisRemoveDeletedRefsopenopenopenopenopenopenopenopenAllopenAllopenAllopenAllopenFetchpushpushregistersetCheckFetchedObjectssetCredentialsProvidersetDeepenNotssetDeepenSincesetDepthsetDepthsetDryRunsetFetchThinsetFilterSpecsetHookErrorStreamsetHookOutputStreamsetObjectCheckersetOptionReceivePacksetOptionUploadPacksetPackConfigsetPushAtomicsetPushOptionssetPushThinsetPushUseBitmapssetRemoveDeletedRefssetTagOptsetTimeoutunregister

Field Detail

srcback to summary
private InputStream src

Constructor Detail

TransportBundleStreamback to summary
public TransportBundleStream(final Repository db, final URIish uri, final InputStream in)

Create a new transport to fetch objects from a streamed bundle.

The stream can be unbuffered (buffering is automatically provided internally to smooth out short reads) and unpositionable (the stream is read from only once, sequentially).

When the FetchConnection or the this instance is closed the supplied input stream is also automatically closed. This frees callers from needing to keep track of the supplied stream.

Parameters
db:Repository

repository the fetched objects will be loaded into.

uri:URIish

symbolic name of the source of the stream. The URI can reference a non-existent resource. It is used only for exception reporting.

in:InputStream

the stream to read the bundle from.

Method Detail

closeback to summary
public void close()

Implements abstract org.eclipse.jgit.transport.Transport.close.

Implements java.lang.AutoCloseable.close.

Doc from org.eclipse.jgit.transport.Transport.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Close any resources used by this transport.

If the remote repository is contacted by a network socket this method must close that network socket, disconnecting the two peers. If the remote repository is actually local (same system) this method must close any open file handles used to read the "remote" repository.

AutoClosable.close() declares that it throws Exception. Implementers shouldn't throw checked exceptions. This override narrows the signature to prevent them from doing so.

Annotations
@Override
openFetchback to summary
public FetchConnection openFetch() throws TransportException

Implements abstract org.eclipse.jgit.transport.Transport.openFetch.

Doc from org.eclipse.jgit.transport.Transport.openFetch.

Begins a new connection for fetching from the remote repository.

If the transport has no local repository, the fetch connection can only be used for reading remote refs.

Returns:FetchConnection

a fresh connection to fetch from the remote repository.

Annotations
@Override
Exceptions
TransportException:
the remote connection could not be established.
openPushback to summary
public PushConnection openPush() throws NotSupportedException

Implements abstract org.eclipse.jgit.transport.Transport.openPush.

Doc from org.eclipse.jgit.transport.Transport.openPush.

Begins a new connection for pushing into the remote repository.

Returns:PushConnection

a fresh connection to push into the remote repository.

Annotations
@Override
Exceptions
NotSupportedException:
the implementation does not support pushing.