GitHubRepo

class GitHubRepo(ownerType: OwnerType, ownerName: String, repoName: String, scheme: String = "https://", domainName: String = GITHUB) : AbstractRepo

A ContentRoot representing a GitHub repository.

Raw content for github.com is fetched from raw.githubusercontent.com. For any other domain (GitHub Enterprise Server) it is fetched from the HOSTNAME/raw/ path, the form used when subdomain isolation is disabled; a server with subdomain isolation enabled serves raw content from raw.HOSTNAME instead, which this class does not detect.

Parameters

ownerType

whether the owner is a user or organization

ownerName

the GitHub username or organization name

repoName

the repository name

scheme

the URL scheme, defaults to "https://"

domainName

the GitHub domain, defaults to "github.com"

Constructors

Link copied to clipboard
constructor(ownerType: OwnerType, ownerName: String, repoName: String, scheme: String = "https://", domainName: String = GITHUB)

Properties

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

The URL prefix used to access raw file content from this repository.

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

Whether this root points to a remote location.

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

The prefix path or URL used to resolve files within this root.

Functions

Link copied to clipboard
open override fun file(path: String): UrlSource

Creates a ContentSource for path within this root.

fun file(path: String, connectTimeout: Duration, readTimeout: Duration, fetchTimeout: Duration, maxBytes: Long, followRedirects: Boolean): UrlSource

Creates a UrlSource for path with timeouts given as java.time.Duration and every limit, for Java callers: the overload taking Kotlin durations cannot be called from Java.

fun file(path: String, connectTimeout: Duration = DEFAULT_CONNECT_TIMEOUT, readTimeout: Duration = DEFAULT_READ_TIMEOUT, fetchTimeout: Duration = Duration.INFINITE, maxBytes: Long = Long.MAX_VALUE, followRedirects: Boolean = false): UrlSource

Creates a UrlSource for path, as file does, with the given timeouts and limits; see UrlSource for each.

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