public class LfsPointer extends Object implements Comparable<LfsPointer>
| Modifier and Type | Field and Description |
|---|---|
static String |
HASH_FUNCTION_NAME
The name of the hash function as used in the pointer files.
|
static int |
SIZE_THRESHOLD
Don't inspect files that are larger than this threshold to avoid
excessive reading.
|
static String |
VERSION
The version of the LfsPointer file format
|
static String |
VERSION_LEGACY
The version of the LfsPointer file format using legacy URL
|
| Constructor and Description |
|---|
LfsPointer(AnyLongObjectId oid,
long size)
Constructor for LfsPointer.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(LfsPointer o) |
void |
encode(OutputStream out)
Encode this object into the LFS format defined by
VERSION |
boolean |
equals(Object obj) |
AnyLongObjectId |
getOid()
Getter for the field
oid. |
long |
getSize()
Getter for the field
size. |
int |
hashCode() |
static LfsPointer |
parseLfsPointer(InputStream in)
Try to parse the data provided by an InputStream to the format defined by
VERSION. |
String |
toString() |
public static final String VERSION
public static final String VERSION_LEGACY
public static final int SIZE_THRESHOLD
public static final String HASH_FUNCTION_NAME
public LfsPointer(AnyLongObjectId oid, long size)
Constructor for LfsPointer.
oid - the id of the contentsize - the size of the contentpublic AnyLongObjectId getOid()
Getter for the field oid.
public long getSize()
Getter for the field size.
public void encode(OutputStream out)
VERSIONout - the OutputStream into which the encoded data should be
written@Nullable public static LfsPointer parseLfsPointer(InputStream in) throws IOException
VERSION. If the given stream supports mark and reset as
indicated by InputStream.markSupported(), its input position will
be reset if the stream content is not actually a LFS pointer (i.e., when
null is returned). If the stream content is an invalid LFS
pointer or the given stream does not support mark/reset, the input
position may not be reset.in - the InputStream from where to read the dataLfsPointer or null if the
stream was not parseable as LfsPointerIOExceptionpublic int compareTo(LfsPointer o)
compareTo in interface Comparable<LfsPointer>Copyright © 2024 Eclipse JGit Project. All rights reserved.