java.lang.Object
overrungl.os.OperatingSystem
The operating system.
- Since:
- 0.1.0
- Author:
- Gradle
-
Method Summary
Modifier and TypeMethodDescriptionstatic OperatingSystem
current()
findAllInPath
(String name) @Nullable File
findInPath
(String name) Locates the given executable in the system path.static OperatingSystem
getArch()
abstract String
getExecutableName
(String executablePath) abstract String
abstract String
abstract String
getLinkLibraryName
(String libraryPath) abstract String
getName()
abstract String
getPath()
abstract String
getScriptName
(String scriptPath) abstract String
getSharedLibraryName
(String libraryName) abstract String
abstract String
getStaticLibraryName
(String libraryName) abstract String
boolean
isLinux()
boolean
isMacOsX()
boolean
isUnix()
boolean
static String
removeExtension
(String filePath) Removes the extension (if any) from the file path.toString()
static String
withExtension
(String filePath, String extension) Returns a representation of the file path with an alternate extension.
-
Method Details
-
current
-
forName
-
toString
-
getName
-
getVersion
-
getArch
-
isWindows
public boolean isWindows() -
isUnix
public boolean isUnix() -
isMacOsX
public boolean isMacOsX() -
isLinux
public boolean isLinux() -
getNativePrefix
-
getScriptName
-
getExecutableName
-
getExecutableSuffix
-
getStaticLibraryName
-
getStaticLibrarySuffix
-
getLinkLibrarySuffix
-
getLinkLibraryName
-
getFamilyName
-
findInPath
Locates the given executable in the system path. Returns null if not found. -
findAllInPath
-
getPath
-
getPathVar
-
withExtension
Returns a representation of the file path with an alternate extension. If the file path has no extension, then the provided extension is simply concatenated. If the file path has an extension, the extension is stripped and replaced with the provided extension.e.g. with a provided extension of ".bar" foo -> foo.bar foo.baz -> foo.bar
- Parameters:
filePath
- the file path to transformextension
- the extension to use in the transformed path- Returns:
- the transformed path
-
removeExtension
Removes the extension (if any) from the file path. If the file path has no extension, then it returns the same string.- Returns:
- the file path without an extension
-