Package net.ssehub.easy.basics
Class Environment
- java.lang.Object
-
- net.ssehub.easy.basics.Environment
-
public class Environment extends java.lang.ObjectStatic utility functions regarding the environment of EASy.- Author:
- El-Sharkawy
-
-
Constructor Summary
Constructors Modifier Constructor Description privateEnvironment()Should avoid instances of this class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisWinOS()Checks whether this program is currently running on a Windows machine.private static intparseVersionPart(java.lang.String version, int part)Parses the numerical version part fromversion.static booleanrunsInEclipse()Checks whether EASy runs inside of Eclipse.static java.io.FiletoFile(java.net.URL localURL)Converts the givenURLto anFile.
-
-
-
Method Detail
-
runsInEclipse
public static boolean runsInEclipse()
Checks whether EASy runs inside of Eclipse. Overridden to non-eclipse if system propertyeasy.notInEclipseis somehow set.- Returns:
- true if EASy runs inside of Eclipse, false otherwise.
-
parseVersionPart
private static int parseVersionPart(java.lang.String version, int part)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:
- true if The current OS is a windows machine, false otherwise.
-
toFile
public static java.io.File toFile(java.net.URL localURL)
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.
-
-