Implementations are responsible for resolving path names relative to the
objects/ subdirectory of a single remote Git repository or
naked object database and make the content available as a Java input stream
for reading during fetch. The actual object traversal logic to determine the
names of files to retrieve is handled through the generic, protocol
independent WalkFetchConnection.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract void | |
| pack-priv void | deleteFile(String
name of the item to be removed, relative to the current object
database. path)Delete a file from the object database. |
| pack-priv void | |
| pack-priv void | deleteRefLog(String
name of the ref within the ref space, for example
name)refs/heads/pu.Delete a reflog from the remote repository. |
| pack-priv abstract Collection | Returns: list of additional object databases the caller could fetch from; null or empty list if none are configured.Obtain alternate connections to alternate object databases (if any). |
| pack-priv abstract Collection | Returns: list of pack names; null or empty list if none are available.Obtain the list of available packs (if any). |
| pack-priv abstract URIish | |
| pack-priv abstract WalkRemoteObjectDatabase. | |
| pack-priv abstract WalkRemoteObjectDatabase | Returns: a new database connection that can read from the specified alternate.the location of the new alternate, relative to the current
object database. location)Create a new connection for a discovered alternate object database
This method is typically called by |
| pack-priv BufferedReader | Returns: a stream to read from the file. Never null.location of the file to read, relative to this objects
directory (e.g. path)info/packs).Open a buffered reader around a file. |
| pack-priv Collection | Returns: the list of discovered alternates. Empty list if the file exists, but no entries were discovered.location of the alternate file to read, relative to this
object database (e.g. listPath)info/alternates).Read a standard Git alternates file to discover other object databases. |
| protected void | readPackedRefs(Map<String, Ref>
return collection of references. Any existing entries will be
replaced if they are found in the packed-refs file. avail)Read a standard Git packed-refs file to discover known references. |
| private void | |
| pack-priv OutputStream | Returns: stream to write into this file. Caller must close the stream to complete the write request. The stream is not buffered and each write may cause a network request/response so callers should buffer to smooth out small writes.name of the file to write, relative to the current object
database. path, final ProgressMonitor (optional) progress monitor to post write completion to during
the stream's close method. monitor, final String (optional) task name to display during the close method. monitorTask)Open a remote file for writing. |
| pack-priv void | |
| pack-priv void | writeInfoPacks(Collection<String>
names of available pack files, in the order they should appear
in the file. Valid pack name strings are of the form
packNames)pack-035760ab452d6eebd123add421f253ce7682355a.pack.Rebuild the |
| pack-priv void |
| INFO_PACKS | back to summary |
|---|---|
| pack-priv static final String INFO_PACKS | |
| INFO_REFS | back to summary |
|---|---|
| pack-priv static final String INFO_REFS | |
| ROOT_DIR | back to summary |
|---|---|
| pack-priv static final String ROOT_DIR | |
| WalkRemoteObjectDatabase | back to summary |
|---|---|
| pack-priv WalkRemoteObjectDatabase() | |
| close | back to summary |
|---|---|
| pack-priv abstract void close() Close any resources used by this connection. 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. | |
| deleteFile | back to summary |
|---|---|
| pack-priv void deleteFile(String path) throws IOException Delete a file from the object database.
Path may start with When possible empty directories must be removed, up to but not including the current object database directory itself. This method does not support deletion of directories.
| |
| deleteRef | back to summary |
|---|---|
| pack-priv void deleteRef(String name) throws IOException Delete a loose ref from the remote repository.
| |
| deleteRefLog | back to summary |
|---|---|
| pack-priv void deleteRefLog(String name) throws IOException Delete a reflog from the remote repository.
| |
| getAlternates | back to summary |
|---|---|
| pack-priv abstract Collection Obtain alternate connections to alternate object databases (if any).
Alternates are typically read from the file
Alternates may reuse the same network connection handle, however the
fetch connection will
| |
| getPackNames | back to summary |
|---|---|
| pack-priv abstract Collection Obtain the list of available packs (if any).
Pack names should be the file name in the packs directory, that is
| |
| getURI | back to summary |
|---|---|
| pack-priv abstract URIish getURI() | |
| open | back to summary |
|---|---|
| pack-priv abstract WalkRemoteObjectDatabase. Open a single file for reading.
Implementors should make every attempt possible to ensure
This method is recommended for already compressed files like loose objects
and pack files. For text files, see
| |
| openAlternate | back to summary |
|---|---|
| pack-priv abstract WalkRemoteObjectDatabase openAlternate(String location) throws IOException Create a new connection for a discovered alternate object database
This method is typically called by
| |
| openReader | back to summary |
|---|---|
| pack-priv BufferedReader openReader(String path) throws IOException Open a buffered reader around a file.
This method is suitable for reading line-oriented resources like
| |
| readAlternates | back to summary |
|---|---|
| pack-priv Collection Read a standard Git alternates file to discover other object databases.
This method is suitable for reading the standard formats of the
alternates file, such as found in Alternates appear one per line, with paths expressed relative to this object database.
| |
| readPackedRefs | back to summary |
|---|---|
| protected void readPackedRefs(Map<String, Ref> avail) throws TransportException Read a standard Git packed-refs file to discover known references.
| |
| readPackedRefsImpl | back to summary |
|---|---|
| private void readPackedRefsImpl(final Map<String, Ref> avail, final BufferedReader br) throws IOException | |
| writeFile | back to summary |
|---|---|
| pack-priv OutputStream writeFile(final String path, final ProgressMonitor monitor, final String monitorTask) throws IOException Open a remote file for writing.
Path may start with The requested path may or may not exist. If the path already exists as a file the file should be truncated and completely replaced. This method creates any missing parent directories, if necessary.
| |
| writeFile | back to summary |
|---|---|
| pack-priv void writeFile(String path, byte[] data) throws IOException Atomically write a remote file. This method attempts to perform as atomic of an update as it can, reducing (or eliminating) the time that clients might be able to see partial file content. This method is not suitable for very large transfers as the complete content must be passed as an argument.
Path may start with The requested path may or may not exist. If the path already exists as a file the file should be truncated and completely replaced. This method creates any missing parent directories, if necessary.
| |
| writeInfoPacks | back to summary |
|---|---|
| pack-priv void writeInfoPacks(Collection<String> packNames) throws IOException Rebuild the
This method rebuilds the contents of the
| |
| writeRef | back to summary |
|---|---|
| pack-priv void writeRef(String name, ObjectId value) throws IOException Overwrite (or create) a loose ref in the remote repository. This method creates any missing parent directories, if necessary.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final InputStream | |
| pack-priv final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | FileStream(InputStream
stream containing the file data. This stream will be
closed by the caller when reading is complete. i)Create a new stream of unknown length. |
| pack-priv | FileStream(InputStream
stream containing the file data. This stream will be
closed by the caller when reading is complete. i, long total number of bytes available for reading through
n)i.Create a new stream of known length. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv byte[] |
| in | back to summary |
|---|---|
| pack-priv final InputStream in | |
| length | back to summary |
|---|---|
| pack-priv final long length | |
| FileStream | back to summary |
|---|---|
| pack-priv FileStream(InputStream i) Create a new stream of unknown length.
| |
| FileStream | back to summary |
|---|---|
| pack-priv FileStream(InputStream i, long n) Create a new stream of known length.
| |
| toArray | back to summary |
|---|---|
| pack-priv byte[] toArray() throws IOException | |