public final class

ExecutablePathUtils

extends Object
java.lang.Object
   ↳ com.atlassian.bamboo.v2.build.agent.capability.ExecutablePathUtils

Summary

Public Methods
@Nullable static File detectExecutableOnPath(String executableName)
Detects the executable home directory and validates that it matches the required pattern using existsInHomeBinExePattern(String, String)
static boolean existsInHomeBinExePattern(String homePath, String executableName)
Validates that the executable exists at the path ${homePath}/bin/${executableName} Appends ".bat" to the executable name if the platform is Windows
@Nullable static File findExecutable(String executableName, Predicate<File> validityPredicate, String envHomeDir, String fhsHome)
This method will return the executable home path, searching first in environment home, then on PATH, finally in a FHS - compliant directory.
@Nullable static String findExecutablePath(String executableName)
Finds the path of the executable given its name.
@Nullable static File getHomeFromExecutableInHomeBin(File executable)
Gets the home directory for an executable if its parent directory is 'bin'
@NotNull static String makeBatchIfOnWindows(String builder)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

@Nullable public static File detectExecutableOnPath (String executableName)

Detects the executable home directory and validates that it matches the required pattern using existsInHomeBinExePattern(String, String)

Parameters
executableName of the builder executable
Returns
  • home

public static boolean existsInHomeBinExePattern (String homePath, String executableName)

Validates that the executable exists at the path ${homePath}/bin/${executableName} Appends ".bat" to the executable name if the platform is Windows

Returns
  • matches

@Nullable public static File findExecutable (String executableName, Predicate<File> validityPredicate, String envHomeDir, String fhsHome)

This method will return the executable home path, searching first in environment home, then on PATH, finally in a FHS - compliant directory.

Parameters
executableName executable name to search for
validityPredicate predicate used to validate the executable path
envHomeDir home directory from environment
fhsHome FHS-compliant home directory
Returns
  • file to executable

@Nullable public static String findExecutablePath (String executableName)

Finds the path of the executable given its name.

Parameters
executableName of the executable
Returns
  • path

@Nullable public static File getHomeFromExecutableInHomeBin (File executable)

Gets the home directory for an executable if its parent directory is 'bin'

Parameters
executable the executable file used to detect the home directory
Returns
  • homeDir

@NotNull public static String makeBatchIfOnWindows (String builder)