java.lang.Object
overrungl.os.OperatingSystem
The operating system.
- Since:
- 0.1.0
- Author:
- Gradle
-
Method Summary
Modifier and TypeMethodDescriptionstatic OperatingSystemcurrent()findAllInPath(String name) @Nullable FilefindInPath(String name) Locates the given executable in the system path.static OperatingSystemgetArch()abstract StringgetExecutableName(String executablePath) abstract Stringabstract Stringabstract StringgetLinkLibraryName(String libraryPath) abstract StringgetName()abstract StringgetPath()abstract StringgetScriptName(String scriptPath) abstract StringgetSharedLibraryName(String libraryName) abstract Stringabstract StringgetStaticLibraryName(String libraryName) abstract StringbooleanisLinux()booleanisMacOsX()booleanisUnix()booleanstatic StringremoveExtension(String filePath) Removes the extension (if any) from the file path.toString()static StringwithExtension(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
-