com.xebialabs.deployit.ci
Enum OperatingSystemFamily

java.lang.Object
  extended by java.lang.Enum<OperatingSystemFamily>
      extended by com.xebialabs.deployit.ci.OperatingSystemFamily
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<OperatingSystemFamily>

public enum OperatingSystemFamily
extends java.lang.Enum<OperatingSystemFamily>

The family (flavour) of the operating system running on a host.


Enum Constant Summary
UNIX
          An operating system from the Unix family: Linux, AIX, MacOS, etc.
WINDOWS
          An operating system from the Windows family: NT, XP, Server 2003, Vista, etc.
 
Method Summary
 java.lang.String convertText(java.lang.String text)
          Converts a text to use the line separator of this operating system family.
 java.lang.String getDefaultTemporaryDirectoryPath()
          Returns the default path of the temporary directory for this operating system family, i.e.
 java.lang.String getFileSeparator()
          Returns the character used by the operating system family to separate components of a file path, e.g.
 java.lang.String getLineSeparator()
          Returns the characters used by the operating system family to separate line in a text file, e.g.
 java.lang.String getPathSeparator()
          Returns the character used by the operating system family to separate components of a path, e.g.
 java.lang.String getScriptExtension()
          Returns the extension for scripts used by the operating system family, e.g.
static OperatingSystemFamily valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static OperatingSystemFamily[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

WINDOWS

public static final OperatingSystemFamily WINDOWS
An operating system from the Windows family: NT, XP, Server 2003, Vista, etc.


UNIX

public static final OperatingSystemFamily UNIX
An operating system from the Unix family: Linux, AIX, MacOS, etc.

Method Detail

values

public static OperatingSystemFamily[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (OperatingSystemFamily c : OperatingSystemFamily.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static OperatingSystemFamily valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getScriptExtension

public java.lang.String getScriptExtension()
Returns the extension for scripts used by the operating system family, e.g. .bat or .sh

Returns:
the script extension including the preceding dot

getLineSeparator

public java.lang.String getLineSeparator()
Returns the characters used by the operating system family to separate line in a text file, e.g. \r\n or \n

Returns:
the line separator

getDefaultTemporaryDirectoryPath

public java.lang.String getDefaultTemporaryDirectoryPath()
Returns the default path of the temporary directory for this operating system family, i.e. C:\temp or /tmp.

Returns:
the path

getFileSeparator

public java.lang.String getFileSeparator()
Returns the character used by the operating system family to separate components of a file path, e.g. \ or /.

Returns:
the file separator.

getPathSeparator

public java.lang.String getPathSeparator()
Returns the character used by the operating system family to separate components of a path, e.g. ; or :.

Returns:
the file separator.

convertText

public java.lang.String convertText(java.lang.String text)
Converts a text to use the line separator of this operating system family.

Parameters:
text - the text to convert.
Returns:
the converted text.


Copyright © 2010. All Rights Reserved.