Top Fields Constructors Methods
org.eclipse.jgit.internal.storage.file

pack-priv Class LocalCachedPack

extends CachedPack
Class Inheritance
Imports
java.io.File, .FileNotFoundException, .IOException, java.util.List, org.eclipse.jgit.internal.storage.pack.CachedPack, .ObjectToPack, .PackExt, .PackOutputStream, .StoredObjectRepresentation

Field Summary

Modifier and TypeField and Description
private final ObjectDirectory
private final String[]
private Pack[]

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public long
getObjectCount()

Implements abstract org.eclipse.jgit.internal.storage.pack.CachedPack.getObjectCount.

Get the number of objects in this pack.

private Pack
getPackFile(String packName)

private String
private Pack[]
public boolean
hasObject(ObjectToPack
the object being packed. Can be used as an ObjectId.
obj
,
StoredObjectRepresentation
representation from the org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs instance that originally supplied this CachedPack.
rep
)

Implements abstract org.eclipse.jgit.internal.storage.pack.CachedPack.hasObject.

Determine if this pack contains the object representation given.

Inherited from org.eclipse.jgit.internal.storage.pack.CachedPack:
getDeltaCount

Field Detail

odbback to summary
private final ObjectDirectory odb
packNamesback to summary
private final String[] packNames
packsback to summary
private Pack[] packs

Constructor Detail

LocalCachedPackback to summary
pack-priv LocalCachedPack(ObjectDirectory odb, List<String> packNames)
LocalCachedPackback to summary
pack-priv LocalCachedPack(List<Pack> packs)

Method Detail

copyAsIsback to summary
pack-priv void copyAsIs(PackOutputStream out, WindowCursor wc) throws IOException
getObjectCountback to summary
public long getObjectCount() throws IOException

Implements abstract org.eclipse.jgit.internal.storage.pack.CachedPack.getObjectCount.

Doc from org.eclipse.jgit.internal.storage.pack.CachedPack.getObjectCount.

Get the number of objects in this pack.

Returns:long

the total object count for the pack.

Annotations
@Override
Exceptions
IOException:
if the object count cannot be read.
getPackFileback to summary
private Pack getPackFile(String packName) throws FileNotFoundException
getPackFilePathback to summary
private String getPackFilePath(String packName)
getPacksback to summary
private Pack[] getPacks() throws FileNotFoundException
hasObjectback to summary
public boolean hasObject(ObjectToPack obj, StoredObjectRepresentation rep)

Implements abstract org.eclipse.jgit.internal.storage.pack.CachedPack.hasObject.

Doc from org.eclipse.jgit.internal.storage.pack.CachedPack.hasObject.

Determine if this pack contains the object representation given.

PackWriter uses this method during the finding sources phase to prune away any objects from the leading thin-pack that already appear within this pack and should not be sent twice.

Implementors are strongly encouraged to rely on looking at rep only and using its internal state to decide if this object is within this pack. Implementors should ensure a representation from this cached pack is tested as part of org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs#selectObjectRepresentation(PackWriter, org.eclipse.jgit.lib.ProgressMonitor, Iterable) , ensuring this method would eventually return true if the object would be included by this cached pack.

Parameters
obj:ObjectToPack

the object being packed. Can be used as an ObjectId.

rep:StoredObjectRepresentation

representation from the org.eclipse.jgit.internal.storage.pack.ObjectReuseAsIs instance that originally supplied this CachedPack.

Returns:boolean

true if this pack contains this object.

Annotations
@Override