Package net.ssehub.easy.basics
Class Environment
java.lang.Object
net.ssehub.easy.basics.Environment
Static utility functions regarding the environment of EASy.
- Author:
- El-Sharkawy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisWinOS()Checks whether this program is currently running on a Windows machine.private static intparseVersionPart(String version, int part) Parses the numerical version part fromversion.static booleanChecks whether EASy runs inside of Eclipse.static File
-
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 propertyeasy.notInEclipseis 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:
trueif EASy runs inside of Eclipse,falseotherwise.
-
parseVersionPart
Parses the numerical version part fromversion.- Parameters:
version- the textual representation of the (Eclipse) versionpart- the 0-based index for the part to parse- Returns:
- the version number or
0for no result
-
isWinOS
public static boolean isWinOS()Checks whether this program is currently running on a Windows machine.- Returns:
trueif The current OS is a windows machine,falseotherwise.
-
toFile
Converts the givenURLto anFile. TheURLmust 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.
-