GitLabFile

open class GitLabFile(val repo: GitLabRepo, val branchName: String, val srcPath: String, val fileName: String, connectTimeout: Duration = DEFAULT_CONNECT_TIMEOUT, readTimeout: Duration = DEFAULT_READ_TIMEOUT, fetchTimeout: Duration = Duration.INFINITE, maxBytes: Long = Long.MAX_VALUE, followRedirects: Boolean = false) : UrlSource

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

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

Parameters

repo

the GitLab 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)

fetchTimeout

the maximum time for the whole fetch (default none); see UrlSource

maxBytes

the largest body accepted, in bytes (default no limit); see UrlSource

followRedirects

whether to follow HTTP redirects (default false); see UrlSource

Constructors

Link copied to clipboard
constructor(repo: GitLabRepo, branchName: String, srcPath: String, fileName: String, connectTimeout: Duration = DEFAULT_CONNECT_TIMEOUT, readTimeout: Duration = DEFAULT_READ_TIMEOUT, fetchTimeout: Duration = Duration.INFINITE, maxBytes: Long = Long.MAX_VALUE, followRedirects: Boolean = false)
constructor(repo: GitLabRepo, branchName: String, srcPath: String, fileName: String)

Creates a GitLabFile with the default timeouts and limits.

constructor(repo: GitLabRepo, branchName: String, srcPath: String, fileName: String, connectTimeout: Duration, readTimeout: Duration, fetchTimeout: Duration, maxBytes: Long, followRedirects: Boolean)

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

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