In package com.eden.orchid.utilities

class com.eden.orchid.utilities.OrchidUtils

Constructors

public <init>()

Parameters:
  • No parameters

Methods

public final static applyBaseUrl(com.eden.orchid.api.OrchidContext, kotlin.String): String

Parameters:
public final static getRelativeFilename(kotlin.String, kotlin.String): String

Removes the base directory from a file path. Leading slashes are also removed from the resulting file path.

Parameters:
  • sourcePath: String
  • baseDir: String
public final static normalizePath(kotlin.String): String

Replaces a string's OS-dependant file path-separator characters (File.separator) with '/', and also strips any slashes from the beginning and end of the string. This allows us to do path operations using the standard forward slash, bypassing any potential regex-related issues, and also makes it easy to split a path into its exact parts.

Parameters:
  • path: String
public final static parseCommandLineArgs(kotlin.Array((kotlin.String))): MutableMap

Parameters:
  • args: Array
public final static parseCommandArgs(kotlin.String, kotlin.Array((kotlin.String))): MutableMap

Parse input as entered on the command palette or in the Orchid interactive shell. The command input consists of two parts: the first is an ordered input, and the keys for the ordered values are given by paramKeys. The second consists of named key-arg mappings in the same format as used for the command-line flags. The resulting values for the named args do not retain the key in the value array, and the dash is stripped from the key. In addition, single values are lifted out an the array into single values. The two sections are separated by --. As as example: val1 -- -key2 val1 val2 val3, when parsed with paramKeys as ['key1'], results in a mapped form like {'key1': 'val1', 'key2': ['val1', 'val2', 'val3']}.

Parameters:
  • argString: String
  • paramKeys: Array
public final static toSlug(kotlin.String): String

Converts a String to a URL-safe, or 'slug' version. This converts the input to lowercase and replaces all characters with dashes (-) except for alphaneumerics, dashes (-), underscores (_), and forward slashes (/).

Parameters:
  • pathPiece: String
public final static isExternal(kotlin.String): Boolean

Returns true if the input filename represents an external resource. Currently supports http:// and https://

Parameters:
  • fileName: String
public final static first(kotlin.collections.MutableList((com.eden.orchid.utilities.OrchidUtils.first.T))): com.eden.orchid.utilities.OrchidUtils.first.T

Returns the first item in a list if possible, returning null otherwise.

Parameters:
  • items: MutableList
public final static first(java.util.stream.Stream((com.eden.orchid.utilities.OrchidUtils.first.T))): com.eden.orchid.utilities.OrchidUtils.first.T

Parameters:
  • items: Stream
public final static addExtraAssetsTo(com.eden.orchid.api.OrchidContext, kotlin.Array((kotlin.String)), kotlin.Array((kotlin.String)), com.eden.orchid.api.theme.assets.AssetHolder, kotlin.Any, kotlin.String): Unit

Parameters:
public final static addComponentAssets(com.eden.orchid.api.theme.pages.OrchidPage, kotlin.Array((com.eden.orchid.api.theme.components.ComponentHolder)), kotlin.collections.MutableList((com.eden.orchid.api.theme.assets.AssetPage)), java.util.function.Function((com.eden.orchid.api.theme.components.OrchidComponent, kotlin.collections.MutableList((com.eden.orchid.api.theme.assets.AssetPage))))): Unit

Parameters:
public final static not(java.util.function.Predicate((com.eden.orchid.utilities.OrchidUtils.not.T))): Predicate

Parameters:
  • t: Predicate
public final static firstBy(java.util.stream.Stream((com.eden.orchid.utilities.OrchidUtils.firstBy.T)), java.util.function.Function((com.eden.orchid.utilities.OrchidUtils.firstBy.T, com.eden.orchid.utilities.OrchidUtils.firstBy.R))): com.eden.orchid.utilities.OrchidUtils.firstBy.R

Parameters:
  • stream: Stream
  • mapper: Function
public final static firstBy(kotlin.Array((com.eden.orchid.utilities.OrchidUtils.firstBy.T)), java.util.function.Function((com.eden.orchid.utilities.OrchidUtils.firstBy.T, com.eden.orchid.utilities.OrchidUtils.firstBy.R))): com.eden.orchid.utilities.OrchidUtils.firstBy.R

Parameters:
  • items: Array
  • mapper: Function
public final static firstBy(kotlin.collections.MutableCollection((com.eden.orchid.utilities.OrchidUtils.firstBy.T)), java.util.function.Function((com.eden.orchid.utilities.OrchidUtils.firstBy.T, com.eden.orchid.utilities.OrchidUtils.firstBy.R))): com.eden.orchid.utilities.OrchidUtils.firstBy.R

Parameters:
  • items: MutableCollection
  • mapper: Function
public final static inArray(com.eden.orchid.utilities.OrchidUtils.inArray.T, kotlin.Array((com.eden.orchid.utilities.OrchidUtils.inArray.U)), java.util.function.BiPredicate((com.eden.orchid.utilities.OrchidUtils.inArray.T, com.eden.orchid.utilities.OrchidUtils.inArray.U))): Boolean

Parameters:
  • item: com.eden.orchid.utilities.OrchidUtils.inArray.T
  • items: Array
  • condition: BiPredicate
public final static transform(com.eden.orchid.utilities.OrchidUtils.transform.T, kotlin.collections.MutableList((java.util.function.Function((com.eden.orchid.utilities.OrchidUtils.transform.T, ))))): com.eden.orchid.utilities.OrchidUtils.transform.T

Parameters:
  • input: com.eden.orchid.utilities.OrchidUtils.transform.T
  • transformations: MutableList
public final static sha1(java.io.File): String

Parameters:
  • file:
public final static sha1(kotlin.String): String

Parameters:
  • text: String
public final static sha1(java.io.InputStream): String

Parameters:
  • stream:
public final static getTempDir(kotlin.String): Path

Parameters:
  • dirName: String
public final static getTempDir(kotlin.String, kotlin.String): Path

Parameters:
  • baseDir: String
  • dirName: String
public final static getTempDir(kotlin.String, kotlin.Boolean): Path

Parameters:
  • dirName: String
  • asSiblingToBase: Boolean
public final static getTempDir(kotlin.String, kotlin.String, kotlin.Boolean): Path

Parameters:
  • baseDir: String
  • dirName: String
  • asSiblingToBase: Boolean
public final static getCacheDir(kotlin.String): Path

Parameters:
  • dirName: String
public final static elementIsObject(JSONElement): Boolean

Parameters:
public final static elementIsArray(JSONElement): Boolean

Parameters:
public final static elementIsString(JSONElement): Boolean

Parameters:
public final static merge(kotlin.Array((JSONObject))): JSONObject

Parameters:
  • sources: JSONObject
public final static camelcaseToTitleCase(kotlin.String): String

Parameters:
  • camelcase: String