Class Environment

java.lang.Object
net.ssehub.easy.basics.Environment

public class Environment extends Object
Static utility functions regarding the environment of EASy.
Author:
El-Sharkawy
  • Constructor Details

    • Environment

      private Environment()
      Should avoid instances of this class.
  • Method Details

    • runsInEclipse

      public static boolean runsInEclipse()
      Checks whether EASy runs inside of Eclipse. Overridden to non-eclipse if system property easy.notInEclipse is somehow set. There seems to be no safe way, so this method is based on observations and heuristics and may need adjustments over time.
      Returns:
      true if EASy runs inside of Eclipse, false otherwise.
    • parseVersionPart

      private static int parseVersionPart(String version, int part)
      Parses the numerical version part from version.
      Parameters:
      version - the textual representation of the (Eclipse) version
      part - the 0-based index for the part to parse
      Returns:
      the version number or 0 for no result
    • isWinOS

      public static boolean isWinOS()
      Checks whether this program is currently running on a Windows machine.
      Returns:
      true if The current OS is a windows machine, false otherwise.
    • toFile

      public static File toFile(URL localURL)
      Converts the given URL to an File. The URL must point to an element inside the local file system. This method should be used to resolve URL given be Eclipse for resolving locally installed resources. This method should be aware of the white space problem, which may occur if working with URIs.
      Parameters:
      localURL - An url pointing to a local resource, must not be null.
      Returns:
      An file object pointing to the same address, which is able to handle white spaces inside the path.