Package overrungl.os

Class OperatingSystem

java.lang.Object
overrungl.os.OperatingSystem

public abstract class OperatingSystem extends Object
The operating system.
Since:
0.1.0
Author:
Gradle
  • Method Details

    • current

      public static OperatingSystem current()
    • forName

      public static OperatingSystem forName(String os)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getName

      public String getName()
    • getVersion

      public String getVersion()
    • getArch

      public String getArch()
    • isWindows

      public boolean isWindows()
    • isUnix

      public boolean isUnix()
    • isMacOsX

      public boolean isMacOsX()
    • isLinux

      public boolean isLinux()
    • getNativePrefix

      public abstract String getNativePrefix()
    • getScriptName

      public abstract String getScriptName(String scriptPath)
    • getExecutableName

      public abstract String getExecutableName(String executablePath)
    • getExecutableSuffix

      public abstract String getExecutableSuffix()
    • getSharedLibraryName

      public abstract String getSharedLibraryName(String libraryName)
    • getSharedLibrarySuffix

      public abstract String getSharedLibrarySuffix()
    • getStaticLibraryName

      public abstract String getStaticLibraryName(String libraryName)
    • getStaticLibrarySuffix

      public abstract String getStaticLibrarySuffix()
    • getLinkLibrarySuffix

      public abstract String getLinkLibrarySuffix()
    • getLinkLibraryName

      public abstract String getLinkLibraryName(String libraryPath)
    • getFamilyName

      public abstract String getFamilyName()
    • findInPath

      @Nullable public @Nullable File findInPath(String name)
      Locates the given executable in the system path. Returns null if not found.
    • findAllInPath

      public List<File> findAllInPath(String name)
    • getPath

      public List<File> getPath()
    • getPathVar

      public String getPathVar()
    • withExtension

      public static String withExtension(String filePath, String extension)
      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 transform
      extension - the extension to use in the transformed path
      Returns:
      the transformed path
    • removeExtension

      public static String removeExtension(String filePath)
      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