One file within a repository branch whose content contains the searched-for text, together with the line numbers it was found on. Produced by {@link RepoSearchManager}. The content hash is carried alongside the path because repository content is content addressed and heavily shared between repositories and versions, so the same bytes routinely match in many places at once and callers usually want to collapse those into a single result.

Group: Managers


Properties

PropertyReturnsDescription
branchBranchThe branch the matching file was found on.
branchNameStringThe name of the branch the matching file was found on.
contentHashStringThe hash of the file's content. Identical files in different repositories or versions share one hash, so this can be used to collapse results which are really the same bytes found in several places.
dirbooleanTrue when the match is a directory rather than a file, which can only ever be a name match.
lineNumbersList<Integer>The one-based line numbers the search text was found on, in ascending order.
matchedOnStringWhether the search text was found in the file's content or only in its name. Either "content", in which case there are line numbers, or "name", in which case there are not.
matchingLinesList<String>The text of each matching line, in the same order as the line numbers, trimmed and truncated so it can be shown as a snippet in search results.
nameStringThe name of the matching file, without any directories.
pathStringThe path of the matching file as a string, for callers which just want to render it.
pathToFilePathThe path of the matching file within the branch, always beginning with a slash.
repoRepositoryThe repository the matching file lives in.
repoNameStringThe name of the repository the matching file lives in.
typeStringThe node type, using the same single character codes as the repository tree: d for a directory, f for a file.

Methods

getRepo() · getBranch() · getPathToFile() · getPath() · getName() · getContentHash() · getLineNumbers() · getMatchingLines() · getRepoName() · getBranchName() · getMatchedOn() · getType() · isDir()

getRepo()

Returns: Repository

The repository the matching file lives in.

getBranch()

Returns: Branch

The branch the matching file was found on.

getPathToFile()

Returns: Path

The path of the matching file within the branch, always beginning with a slash.

getPath()

Returns: String

The path of the matching file as a string, for callers which just want to render it.

getName()

Returns: String

The name of the matching file, without any directories.

getContentHash()

Returns: String

The hash of the file's content. Identical files in different repositories or versions share one hash, so this can be used to collapse results which are really the same bytes found in several places.

getLineNumbers()

Returns: List<Integer>

The one-based line numbers the search text was found on, in ascending order.

getMatchingLines()

Returns: List<String>

The text of each matching line, in the same order as the line numbers, trimmed and truncated so it can be shown as a snippet in search results.

getRepoName()

Returns: String

The name of the repository the matching file lives in.

getBranchName()

Returns: String

The name of the branch the matching file was found on.

getMatchedOn()

Returns: String

Whether the search text was found in the file's content or only in its name. Either "content", in which case there are line numbers, or "name", in which case there are not.

getType()

Returns: String

The node type, using the same single character codes as the repository tree: d for a directory, f for a file.

isDir()

Returns: boolean

True when the match is a directory rather than a file, which can only ever be a name match.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.