|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<OperatingSystem>
eu.beesoft.gaia.util.OperatingSystem
public enum OperatingSystem
Enumeration for types of operating systems. It has also implemented some static methods to support the operating system dependent operations.
Enum Constant Summary | |
---|---|
MAC
|
|
UNIX
|
|
UNKNOWN
|
|
WINDOWS
|
Method Summary | |
---|---|
static OperatingSystem |
getCurrent()
Returns instance of OperatingSystem which corresponds to the running operating system. |
static java.lang.String |
getCurrentName()
Returns the name of the underlaying operating system. |
static eu.beesoft.gaia.plugin.Version |
getCurrentVersion()
Returns the version of the underlaying operating system. |
boolean |
isCurrent()
Returns true if this enumeration constant corresponds to the running operating system. |
static void |
setFileWriteable(java.io.File file,
boolean value)
Sets file writeable or read-only. |
static void |
startBrowser(java.lang.String url)
Starts browser for given url. |
java.lang.String |
toString()
Returns the string representation of this instance of OperatingSystem (its name and version). |
static OperatingSystem |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static OperatingSystem[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final OperatingSystem WINDOWS
public static final OperatingSystem UNIX
public static final OperatingSystem MAC
public static final OperatingSystem UNKNOWN
Method Detail |
---|
public static final OperatingSystem[] values()
for(OperatingSystem c : OperatingSystem.values()) System.out.println(c);
public static OperatingSystem valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namepublic static OperatingSystem getCurrent()
public boolean isCurrent()
public static java.lang.String getCurrentName()
public static eu.beesoft.gaia.plugin.Version getCurrentVersion()
public java.lang.String toString()
toString
in class java.lang.Enum<OperatingSystem>
public static void startBrowser(java.lang.String url)
url
- - url of web page to view
java.lang.RuntimeException
- if some error occuredpublic static void setFileWriteable(java.io.File file, boolean value)
File.setWritable()
on Java 1.6+. On older versions it
invokes program from running operating system (e.g. attrib
on Windows). When this fails, it tries to copy file, delete it and rename
the copy to the file name.
file
- - the file to change read-only attributevalue
- - the value to set; false for read-only, true for writeable
java.lang.RuntimeException
- if cannot change read-only state
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |