public final class ExecutablePathUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static @Nullable File |
detectExecutableOnPath(@NotNull String executableName)
Detects the executable home directory and validates that it matches the required pattern using
existsInHomeBinExePattern(String, String) |
static boolean |
existsInHomeBinExePattern(@Nullable String homePath,
@NotNull String executableName)
Validates that the executable exists at the path ${homePath}/bin/${executableName}
Appends ".bat" to the executable name if the platform is Windows
|
static @Nullable File |
findExecutable(@NotNull String executableName,
@Nullable com.google.common.base.Predicate<File> validityPredicate,
@Nullable String envHomeDir,
@NotNull List<String> fhsHomes)
This method will return the executable home path, searching first in environment home, then on PATH, finally in a
FHS - compliant directory.
|
static @Nullable File |
findExecutable(@NotNull String executableName,
@Nullable com.google.common.base.Predicate<File> validityPredicate,
@Nullable String envHomeDir,
@Nullable String fhsHome)
This method will return the executable home path, searching first in environment home, then on PATH, finally in a
FHS - compliant directory.
|
static @Nullable String |
findExecutablePath(@NotNull String executableName)
Finds the path of the executable given its name.
|
static Optional<File> |
getExistingExecutable(@Nullable String basePath,
@NotNull String executableName) |
static @Nullable File |
getHomeFromExecutableInHomeBin(@NotNull File executable)
Gets the home directory for an executable if its parent directory is 'bin'
|
static @NotNull String |
makeBatchIfOnWindows(String builder) |
public static boolean existsInHomeBinExePattern(@Nullable
@Nullable String homePath,
@NotNull
@NotNull String executableName)
homePath - executableName - public static Optional<File> getExistingExecutable(@Nullable @Nullable String basePath, @NotNull @NotNull String executableName)
@Nullable public static @Nullable File detectExecutableOnPath(@NotNull @NotNull String executableName)
existsInHomeBinExePattern(String, String)executableName - of the builder executable@Nullable public static @Nullable File getHomeFromExecutableInHomeBin(@NotNull @NotNull File executable)
executable - the executable file used to detect the home directory@Nullable public static @Nullable File findExecutable(@NotNull @NotNull String executableName, @Nullable @Nullable com.google.common.base.Predicate<File> validityPredicate, @Nullable @Nullable String envHomeDir, @Nullable @Nullable String fhsHome)
executableName - executable name to search forvalidityPredicate - predicate used to validate the executable pathenvHomeDir - home directory from environmentfhsHome - FHS-compliant home directory@Nullable public static @Nullable File findExecutable(@NotNull @NotNull String executableName, @Nullable @Nullable com.google.common.base.Predicate<File> validityPredicate, @Nullable @Nullable String envHomeDir, @NotNull @NotNull List<String> fhsHomes)
executableName - executable name to search forvalidityPredicate - predicate used to validate the executable pathenvHomeDir - home directory from environmentfhsHomes - FHS-compliant home directoryCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.