Package-level declarations

Types

Link copied to clipboard
private object CompressionExtensions

Properties

Link copied to clipboard

Map containing the name of compressors to the file extension used to represent files compressed with said algorithm.

Link copied to clipboard

The context of this if this is an exception with context.

Link copied to clipboard
Link copied to clipboard
val <L, R> Pair<L, R>.ktPair: Pair<L, R>
Link copied to clipboard
private val logger: Logger
Link copied to clipboard

The raw message of this, without the exception context.

Functions

Link copied to clipboard
fun Runtime.addShutdownHook(block: () -> Unit)
Link copied to clipboard
fun buildTarArchiveInputStream(builder: TarArchiveOutputStream.() -> Unit): InputStream

Builds a TarArchiveInputStream by converting a TarArchiveOutputStream containing entries created from builder.

Link copied to clipboard
inline fun check(value: Boolean, message: Any, lazyContext: () -> Map<String?, Any?>)

Version of check which throws a ContextedIllegalStateException.

Link copied to clipboard
inline fun <T : Any> checkNotNull(value: T?, message: Any, lazyContext: () -> Map<String?, Any?>): T

Version of check which throws a ContextedIllegalArgumentException.

Link copied to clipboard

Recursively collects the causes of this exception, with the direct cause of this exception appearing first.

Link copied to clipboard
fun Path.collectMatchingGlob(globPattern: String, dotglob: Boolean = false): Pair<Path, Sequence<Path>>

Collects all Path under this directory using globPattern, as if it is invoked in a shell.

Link copied to clipboard
fun Path.compress(compressorName: String, fileExtension: String? = null, readOptions: Array<OpenOption> = emptyArray(), writeOptions: Array<OpenOption> = emptyArray()): Path

Compresses a file and outputs it in the same directory.

Link copied to clipboard
fun Path.decompress(outFile: Path? = null, compressorName: String? = null, readOptions: Array<OpenOption> = emptyArray(), writeOptions: Array<OpenOption> = emptyArray()): Path

Decompresses a file and outputs it in the same directory.

Link copied to clipboard

Deletes all files in this path recursively.

Link copied to clipboard
Link copied to clipboard
inline fun error(message: Any, lazyContext: () -> Map<String?, Any?>): Nothing

Version of error which throws a ContextedIllegalStateException.

Link copied to clipboard
fun String.escapeXSI(keepExpansion: Boolean = false): String

Escapes this as if used by the Shell scripting language.

Link copied to clipboard
fun <E : ArchiveEntry> ArchiveInputStream<E>.fileSequence(): Sequence<E>

Obtains a sequence of files contained within this ArchiveInputStream.

Link copied to clipboard
fun JsonNode?.foldNullAsNative(): JsonNode?

Converts this into the native null type if JsonNode.isNull is true.

Link copied to clipboard
private fun globToRegex(globPattern: String, dotglob: Boolean): Regex
Link copied to clipboard
fun String?.ifNotNullThen(content: (String) -> String): String

Shorthand for null-checking if this is defined (not null) then return content, otherwise return empty string

Link copied to clipboard
fun String.indent(level: Int, indentElem: String = "", withHint: Boolean = true): String

Indents this using a given String.

Link copied to clipboard

Joins this as a space-separated string if it is non-null, otherwise returns empty string.

Link copied to clipboard
fun mapCompressorExtension(compressorName: String): String

Maps the name of a compressor to the file extension typically used by compressed files of the compressor.

Link copied to clipboard
fun Path.mapCopyDest(globPattern: String, dotglob: Boolean = false): Path?

Maps this path to its copy destination based on the globPattern used to collect this path.

Link copied to clipboard
fun <T> List<T>.nonEmptyOrNull(): List<T>?

If this is non-empty, return the list itself, otherwise mark it as null

Link copied to clipboard
fun <K, V> MutableMap<K, V>.put(pair: Pair<K, V>): V?

Puts pair to this with Pair.first as key and Pair.second as value

Link copied to clipboard
infix fun List<Char>.randomString(length: Int): String
Link copied to clipboard
inline fun require(value: Boolean, message: Any, lazyContext: () -> Map<String?, Any?>)

Version of require which throws a ContextedIllegalArgumentException.

Link copied to clipboard
inline fun <T : Any> requireNotNull(value: T?, message: Any, lazyContext: () -> Map<String?, Any?>): T
Link copied to clipboard
fun Double.roundTo(decimalPlace: Int): Double

Rounds this to a Double of decimalPlace-many decimal places

Link copied to clipboard
inline fun Map<String?, Any?>.toContextArray(): Array<Pair<String?, Any?>>
Link copied to clipboard

Converts this into 1 or 0 depending on its value.

Link copied to clipboard

Converts this to a representation String using formatting (up to 6 digits).

Link copied to clipboard

Escapes this as if used by the Java, which is also equivalent to that of ANSI C.

Link copied to clipboard
inline fun <T : AutoCloseable?> T.useWith(block: T.() -> Unit): T

Extended use scoping function with receiver Similar to apply which returns itself this

Link copied to clipboard
inline fun Exception.withContext(vararg context: Pair<String?, Any?>): ContextedException

Converts this into a ContextedException with context attached.

Converts this exception into a ContextedRuntimeException with context attached.

Link copied to clipboard

Wraps this with the given string, i.e. prepends and appends wrap to this string.

Link copied to clipboard
fun TarArchiveOutputStream.writeDirectoryEntry(path: Path): TarArchiveOutputStream
Link copied to clipboard
fun TarArchiveOutputStream.writeEntry(path: Path, rootDir: Path, recursive: Boolean = false, newRoot: Path? = null): TarArchiveOutputStream