com.microfocus.awm.core.internal

## Class InputStreamFileDescriptorReader

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

- All Implemented Interfaces:
    IFileDescriptorReader

      public class InputStreamFileDescriptorReader
      extends java.lang.Object
      implements IFileDescriptorReader

  `IFileDescriptorReader` implementation for file descriptors of the type `EFileTypes.INPUT_STREAM`.
  Author:
    Ralf Pakosch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InputStreamFileDescriptorReader()`

  - ### Method Summary

    All Methods Instance Methods Concrete 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)` The content of the input stream is get with the code page "UTF-8"
    `void` | `setContents(java.io.InputStream pInputStream, FileDescriptor pFileDescriptor, IExecutionContext pContext, org.eclipse.core.runtime.IProgressMonitor pMon)` Sets the contents of the target file.

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

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

- - ### Constructor Detail

    - #### InputStreamFileDescriptorReader

          public InputStreamFileDescriptorReader()

  - ### Method Detail

    - #### getContents

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

      The content of the input stream is get with the code page "UTF-8"
      Specified by:
        `getContents` in interface `IFileDescriptorReader`
      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

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

      Description copied from interface: `IFileDescriptorReader`
      Sets the contents of the target file.
      Specified by:
        `setContents` in interface `IFileDescriptorReader`
      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

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

      Description copied from interface: `IFileDescriptorReader`
      Checks whether the file exists on the target system.
      Specified by:
        `fileExists` in interface `IFileDescriptorReader`
      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.