com.microfocus.awm.control.toolexecution.internal

## Class FileData

- java.lang.Object
- - com.microfocus.awm.control.toolexecution.internal.FileData

- All Implemented Interfaces:
    IFileData

      public class FileData
      extends java.lang.Object
      implements IFileData

  File data implementation which always reads the file descriptor for obtaining raw contents or file elements.
  Author:
    RalfP

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileData(FileDescriptor pFileDescriptor, IExecutionContext pContext)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IPropertyData` | `getPropertyData()` Returns the parsed contents of a structured file.
    `IGetDataResponse` | `getRawContents()` Gets the raw, unparsed contents of the file descriptor.

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

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

- - ### Constructor Detail

    - #### FileData

          public FileData(FileDescriptor pFileDescriptor,
                          IExecutionContext pContext)

      Constructor.
      Parameters:
        `pFileDescriptor` - file descriptor to get the data from
        `pContext` - execution context used to resolve property references in the file descriptor

  - ### Method Detail

    - #### getPropertyData

          public IPropertyData getPropertyData()
                                        throws TaurusCoreException

      Description copied from interface: `IFileData`
      Returns the parsed contents of a structured file. It calls `IStructureType.readStructure(FileDescriptor, String)` of the file descriptors structure type.
      Specified by:
        `getPropertyData` in interface `IFileData`
      Returns:
        the structured file's contents mapped to properties according to the file descriptors `IStructure`
      Throws:
        `TaurusCoreException` -
        - If parsing a structured file descriptor fails.
        - If the file descriptor is unstructured.
        - If the file descriptor's `IStructureType` cannot be found or is invalid.

    - #### getRawContents

          public IGetDataResponse getRawContents()
                                          throws TaurusCoreException

      Description copied from interface: `IFileData`
      Gets the raw, unparsed contents of the file descriptor.
      Specified by:
        `getRawContents` in interface `IFileData`
      Returns:
        the file contents
      Throws:
        `TaurusCoreException` - if retrieving the file contents fails

Copyright © 2015 Micro Focus GmbH. All rights reserved.