public class LfsPointer extends java.lang.Object implements java.lang.Comparable<LfsPointer>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HASH_FUNCTION_NAME
The name of the hash function as used in the pointer files.
|
private AnyLongObjectId |
oid |
private long |
size |
static int |
SIZE_THRESHOLD
Don't inspect files that are larger than this threshold to avoid
excessive reading.
|
static java.lang.String |
VERSION
The version of the LfsPointer file format
|
static java.lang.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(java.io.OutputStream out)
Encode this object into the LFS format defined by
VERSION |
AnyLongObjectId |
getOid()
Getter for the field
oid. |
long |
getSize()
Getter for the field
size. |
static LfsPointer |
parseLfsPointer(java.io.InputStream in)
Try to parse the data provided by an InputStream to the format defined by
VERSION |
java.lang.String |
toString() |
public static final java.lang.String VERSION
public static final java.lang.String VERSION_LEGACY
public static final int SIZE_THRESHOLD
public static final java.lang.String HASH_FUNCTION_NAME
private AnyLongObjectId oid
private long size
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(java.io.OutputStream out)
VERSIONout - the OutputStream into which the encoded data should be
written@Nullable public static LfsPointer parseLfsPointer(java.io.InputStream in) throws java.io.IOException
VERSIONin - the InputStream from where to read the dataLfsPointer or null
if the stream was not parseable as LfsPointerjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(LfsPointer o)
compareTo in interface java.lang.Comparable<LfsPointer>