Enum Class Platform

java.lang.Object
java.lang.Enum<Platform>
com.sap.cds.maven.plugin.util.Platform
All Implemented Interfaces:
Serializable, Comparable<Platform>, Constable

public enum Platform extends Enum<Platform>
This enum contains all supported platforms.
  • Enum Constant Details

    • LINUX

      public static final Platform LINUX
      Running on a Linux operating system
    • MAC

      public static final Platform MAC
      Running on Mac OS (Darwin)
    • WINDOWS

      public static final Platform WINDOWS
      Running on a Windows operating system
  • Field Details

    • CURRENT

      public static final Platform CURRENT
      Contains the current Platform.
    • archiveExtension

      public final String archiveExtension
      Contains the Node.js archive extension.
    • node

      public final String node
      Contains name of node executable, either "node" or "node.exe".
    • nodeClassifier

      public final String nodeClassifier
      Contains the Node.js classifier: "linux-x64", "darwin-x64" or "win-x64"
    • npm

      public final String npm
      Contains name of npm executable, either "npm" or "npm.cmd".
    • npx

      public final String npx
      Contains name of npx executable, either "npx" or "npx.cmd".
  • Method Details

    • values

      public static Platform[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Platform valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getDownloadPath

      public String getDownloadPath(String nodeVersion)
      Calculates the relative Node.js download path.
      Parameters:
      nodeVersion - the Node.js version
      Returns:
      the calculated relative download path
    • getNodePath

      public String getNodePath(String nodeVersion)
      Parameters:
      nodeVersion - the Node.js version
      Returns:
      a relative path to node executable for the current platform
    • getNpmPath

      public String getNpmPath(String nodeVersion)
      Parameters:
      nodeVersion - the Node.js version
      Returns:
      a relative path to npm executable for the current platform
    • getNpxPath

      public String getNpxPath(String nodeVersion)
      Parameters:
      nodeVersion - the Node.js version
      Returns:
      a relative path to npx executable for the current platform
    • isWindows

      public boolean isWindows()
      Returns:
      true if the current platform is WINDOWS.