Browse Source

DfsCachedPack: Add accessor for packfile object

In order to support implementations of CachedPackUriProvider (which need
to supply, among other things, the checksum of the packfile
corresponding to a CachedPack), in a004820858 ("UploadPack: support
custom packfile-to-URI mapping", 2019-08-20), the method getCheckSum()
was added to PackIndex. However, there is no way to access the PackIndex
from a DfsCachedPack.

Therefore, add an accessor for the DfsPackFile stored in the
DfsCachedPack. Now, a user who has a DfsCachedPack can use
DfsCachedPack#getPackFile then DfsPackFile#getPackIndex then
PackIndex#getCheckSum to obtain the checksum of a pack.

Change-Id: Ia010c016f6cac0f058ee20eff4c10f57338bfefc
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
next
Jonathan Tan 5 years ago
parent
commit
f1f7b42882
  1. 7
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsCachedPack.java

7
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsCachedPack.java

@ -60,6 +60,13 @@ public class DfsCachedPack extends CachedPack {
this.pack = pack; this.pack = pack;
} }
/**
* @return the pack passed to the constructor
*/
public DfsPackFile getPackFile() {
return pack;
}
/** /**
* Get the description of the pack. * Get the description of the pack.
* *

Loading…
Cancel
Save