com.microfocus.awm.core.internal

## Class MasterConfigurationReference

- java.lang.Object
- - com.microfocus.awm.core.internal.MasterConfigurationReference

-     public class MasterConfigurationReference
      extends java.lang.Object

  Reference to a master configuration, which can be either a file name or an operating system command.
  Author:
    RalfP

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `TYPE_COMMAND` Type flag for a master configuration reference with an OS command.
    `static int` | `TYPE_FILE_LOCATION` Type flag for a master configuration reference with a file name.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MasterConfigurationReference(java.lang.String pFileLocationOrCmd, int pType)` Creates a new `MasterConfigurationReference`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getMasterConfigurationCommand()` Gets the operating system command of this master configuration reference.
    `java.lang.String` | `getMasterConfigurationLocation()` Gets the file name of this master configuration file.
    `boolean` | `isCommand()` Whether the master configuration reference is an operating system command.
    `java.io.InputStream` | `readMasterConfiguration()` Reads the master configuration file to an input stream using the standard operating system file encoding.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TYPE_FILE_LOCATION

          public static final int TYPE_FILE_LOCATION

      Type flag for a master configuration reference with a file name.
      See Also:
        Constant Field Values

    - #### TYPE_COMMAND

          public static final int TYPE_COMMAND

      Type flag for a master configuration reference with an OS command.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MasterConfigurationReference

          public MasterConfigurationReference(java.lang.String pFileLocationOrCmd,
                                              int pType)

      Creates a new `MasterConfigurationReference`. Either a file name or operating system command can be specified.
      Parameters:
        `pFileLocationOrCmd` - either a file name or OS command which contains or returns a master configuration
        `pType` - either 0 or 1 depending on whether a file name or an OS command was given as first parameter

  - ### Method Detail

    - #### readMasterConfiguration

          public java.io.InputStream readMasterConfiguration()
                                                      throws java.io.IOException

      Reads the master configuration file to an input stream using the standard operating system file encoding.
      Returns:
        the parsed master configuration file
      Throws:
        `java.io.IOException` - if reading the master configuration fails or executing the OS command caused an exception

    - #### isCommand

          public boolean isCommand()

      Whether the master configuration reference is an operating system command.
      Returns:
        `true` if the master configuration reference is an OS command. Otherwise `false`

    - #### getMasterConfigurationCommand

          public java.lang.String getMasterConfigurationCommand()

      Gets the operating system command of this master configuration reference.
      Returns:
        the operating system command or `null` if the reference is not a command
      See Also:
        `isCommand()`

    - #### getMasterConfigurationLocation

          public java.lang.String getMasterConfigurationLocation()

      Gets the file name of this master configuration file.
      Returns:
        the file name or `null` if the reference a command
      See Also:
        `isCommand()`

Copyright © 2015 Micro Focus GmbH. All rights reserved.