com.microfocus.awm.model

## Interface IFileDescriptorReader

- All Known Implementing Classes:
    InputStreamFileDescriptorReader, LocalFileDescriptorReader, WorkspaceFileDescriptorReader

      public interface IFileDescriptorReader

  File descriptor readers are able to read and write files described by `FileDescriptor`s. Every file descriptor type (`EFileTypes`) requires to have an equivalent file descriptor reader in order for being usable by AWM or the API.

  Cannot effectively be sub-classed by clients, since currently there's no way of extending AWM's list of supported file descriptor types or register new readers.

  Author:
    Ralf Pakosch
  See Also:
    `TaurusUtility.readFile(FileDescriptor, IExecutionContext)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `fileExists(FileDescriptor pFileDescriptor, IExecutionContext pContext, org.eclipse.core.runtime.IProgressMonitor pMon)` Checks whether the file exists on the target system.
    `IGetDataResponse` | `getContents(FileDescriptor pFileDescriptor, IExecutionContext pContext)` Gets the contents of the target file.
    `void` | `setContents(java.io.InputStream pInputStream, FileDescriptor pFileDescriptor, IExecutionContext pContext, org.eclipse.core.runtime.IProgressMonitor pMon)` Sets the contents of the target file.

- - ### Method Detail

    - #### getContents

          IGetDataResponse getContents(FileDescriptor pFileDescriptor,
                                       IExecutionContext pContext)
                                throws java.io.IOException

      Gets the contents of the target file.
      Parameters:
        `pFileDescriptor` - the target file descriptor
        `pContext` - the execution context
      Returns:
        a get data response containing the contents of the file
      Throws:
        `java.io.IOException` - if reading the file fails

    - #### setContents

          void setContents(java.io.InputStream pInputStream,
                           FileDescriptor pFileDescriptor,
                           IExecutionContext pContext,
                           org.eclipse.core.runtime.IProgressMonitor pMon)
                    throws java.io.IOException

      Sets the contents of the target file.
      Parameters:
        `pInputStream` - the new file contents
        `pFileDescriptor` - the target file descriptor
        `pContext` - the execution context
        `pMon` - progress monitor
      Throws:
        `java.io.IOException` - if setting the file contents fails

    - #### fileExists

          boolean fileExists(FileDescriptor pFileDescriptor,
                             IExecutionContext pContext,
                             org.eclipse.core.runtime.IProgressMonitor pMon)
                      throws java.io.IOException

      Checks whether the file exists on the target system.
      Parameters:
        `pFileDescriptor` - the file to check
        `pContext` - the execution context
        `pMon` - a progress monitor
      Returns:
        `true` if the file exists, otherwise `false`
      Throws:
        `java.io.IOException` - if an error occurs while checking the file existence

Copyright © 2015 Micro Focus GmbH. All rights reserved.