Class HostSystem

java.lang.Object
io.github.ascopes.protobufmavenplugin.utils.HostSystem

@Description("Discovers information about the platform that the plugin is being invoked on") @Named public final class HostSystem extends Object
A bean that exposes information about the underlying platform and the context of the invocation.
Author:
Ashley Scopes
  • Field Details

    • log

      private static final org.slf4j.Logger log
    • operatingSystem

      private final String operatingSystem
    • cpuArchitecture

      private final String cpuArchitecture
    • pathSeparator

      private final String pathSeparator
    • javaHome

      private final Path javaHome
    • javaVendor

      private final String javaVendor
    • path

      private final List<Path> path
    • pathExt

      private final SortedSet<String> pathExt
  • Constructor Details

  • Method Details

    • getOperatingSystem

      public String getOperatingSystem()
    • getCpuArchitecture

      public String getCpuArchitecture()
    • isProbablyLinux

      public boolean isProbablyLinux()
    • isProbablyTermux

      public boolean isProbablyTermux()
    • isProbablyMacOs

      public boolean isProbablyMacOs()
    • isProbablyWindows

      public boolean isProbablyWindows()
    • getJavaExecutablePath

      public Path getJavaExecutablePath()
    • getSystemPath

      public List<Path> getSystemPath()
    • getPathSeparator

      public String getPathSeparator()
    • getSystemPathExtensions

      public SortedSet<String> getSystemPathExtensions()
    • parsePath

      private static List<Path> parsePath(String rawPath, String pathSeparator)
    • parsePathExt

      private static SortedSet<String> parsePathExt(String rawPathExt, String pathSeparator)
    • tokenizeFilePath

      private static <T> T tokenizeFilePath(String rawValue, String separator, Function<Stream<String>, T> mapper)
    • tryParseSystemFilePath

      private static Function<String, Stream<Path>> tryParseSystemFilePath()
    • optionalFunction

      private static <A,R> Function<A, Optional<R>> optionalFunction(Function<A, @Nullable R> fn)