GitHubFile

open class GitHubFile(val repo: GitHubRepo, val branchName: String, val srcPath: String, val fileName: String, connectTimeout: Duration = DEFAULT_CONNECT_TIMEOUT, readTimeout: Duration = DEFAULT_READ_TIMEOUT) : UrlSource

A ContentSource pointing to a specific file in a GitHub repository.

Resolves branchName, srcPath, and fileName against the repository's GitHubRepo.rawSourcePrefix.

Parameters

repo

the GitHub repository

branchName

the branch or tag name

srcPath

the directory path within the repository

fileName

the file name

connectTimeout

the maximum time to wait for a connection (default 10 seconds)

readTimeout

the maximum time to wait for data once connected (default 30 seconds)

Constructors

Link copied to clipboard
constructor(repo: GitHubRepo, branchName: String, srcPath: String, fileName: String, connectTimeout: Duration = DEFAULT_CONNECT_TIMEOUT, readTimeout: Duration = DEFAULT_READ_TIMEOUT)
constructor(repo: GitHubRepo, branchName: String, srcPath: String, fileName: String)

Creates a GitHubFile with the default timeouts.

Properties

Link copied to clipboard
Link copied to clipboard
open override val content: String

The textual content read from this source.

Link copied to clipboard
Link copied to clipboard
open override val remote: Boolean = true

Whether this source is remote (URL-based).

Link copied to clipboard
Link copied to clipboard
open override val source: String
Link copied to clipboard

Functions

Link copied to clipboard
open override fun toString(): String