java.lang.Object
org.eclipse.jgit.transport.FilterSpec
Represents either a filter specified in a protocol "filter" line, or a
placeholder to indicate no filtering.
- Since:
- 5.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FilterSpec
A placeholder that indicates no filtering. -
Method Summary
Modifier and TypeMethodDescriptionboolean
allowsType
(int type) Whether object type is allowedGet filter line describing this specstatic FilterSpec
fromFilterLine
(String filterLine) Process the content of "filter" line from the protocol.long
Get blob size limitlong
Get tree depth limitboolean
isNoOp()
Whether this filter is a no-op
-
Field Details
-
NO_FILTER
A placeholder that indicates no filtering.
-
-
Method Details
-
fromFilterLine
Process the content of "filter" line from the protocol. It has a shape like:- "blob:none"
- "blob:limit=N", with N >= 0
- "tree:DEPTH", with DEPTH >= 0
- Parameters:
filterLine
- the content of the "filter" line in the protocol- Returns:
- a FilterSpec representing the given filter
- Throws:
PackProtocolException
- invalid filter because due to unrecognized format or negative/non-numeric filter.
-
allowsType
public boolean allowsType(int type) Whether object type is allowed- Parameters:
type
- a Git object type, such asConstants.OBJ_BLOB
- Returns:
- whether this filter allows objects of the specified type
- Since:
- 5.9
-
getBlobLimit
public long getBlobLimit()Get blob size limit- Returns:
- -1 if this filter does not filter blobs based on size, or a non-negative integer representing the max size of blobs to allow
-
getTreeDepthLimit
public long getTreeDepthLimit()Get tree depth limit- Returns:
- -1 if this filter does not filter blobs and trees based on depth, or a non-negative integer representing the max tree depth of blobs and trees to fetch
-
isNoOp
public boolean isNoOp()Whether this filter is a no-op- Returns:
- true if this filter doesn't filter out anything
-
filterLine
Get filter line describing this spec- Returns:
- the filter line which describes this spec, e.g. "filter blob:limit=42"
-