com.versionone.apiclient

## Class FileAPIConnector

- java.lang.Object
- - com.versionone.apiclient.FileAPIConnector

- All Implemented Interfaces:
    IAPIConnector

      public class FileAPIConnector
      extends Object
      implements IAPIConnector

  IAPIConnector that reads data from a file.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileAPIConnector(String fileName, String prefix)` Create Connector

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `OutputStream` | `beginRequest(String path, String contentType)` Operation not supported
    `InputStream` | `endRequest(String path)` Operation not supported
    `InputStream` | `getAttachment(String attachmentKey)` Read data from the path provided Note: Caller is responsible for closing the returned stream
    `Reader` | `getData()` Read data from the root of the connection Note: Caller is responsible for closing the returned stream
    `Reader` | `getData(String path)` Read data from the path provided Note: Caller is responsible for closing the returned stream
    `String` | `getLastData()`
    `String` | `getLastPath()`
    `Reader` | `sendData(String path, String data)` Send data to the path Note: Caller is responsible for closing the returned stream

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

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

- - ### Constructor Detail

    - #### FileAPIConnector

          public FileAPIConnector(String fileName,
                                  String prefix)

      Create Connector
      Parameters:
        `fileName` - - fully qualified filename
        `prefix` - - String

  - ### Method Detail

    - #### getData

          public Reader getData()
                         throws ConnectionException

      Description copied from interface: `IAPIConnector`
      Read data from the root of the connection Note: Caller is responsible for closing the returned stream
      Specified by:
        `getData` in interface `IAPIConnector`
      Returns:
        the stream for reading data
      Throws:
        `ConnectionException` - if any connection problems occur

    - #### getData

          public Reader getData(String path)
                         throws ConnectionException

      Description copied from interface: `IAPIConnector`
      Read data from the path provided Note: Caller is responsible for closing the returned stream
      Specified by:
        `getData` in interface `IAPIConnector`
      Parameters:
        `path` - String
      Returns:
        Reader The stream for reading data
      Throws:
        `ConnectionException` - if any connection problems occur

    - #### getAttachment

          public InputStream getAttachment(String attachmentKey)
                                    throws ConnectionException

      Description copied from interface: `IAPIConnector`
      Read data from the path provided Note: Caller is responsible for closing the returned stream
      Specified by:
        `getAttachment` in interface `IAPIConnector`
      Returns:
        InputStream The stream for reading data
      Throws:
        `ConnectionException`

    - #### sendData

          public Reader sendData(String path,
                                 String data)
                          throws ConnectionException

      Description copied from interface: `IAPIConnector`
      Send data to the path Note: Caller is responsible for closing the returned stream
      Specified by:
        `sendData` in interface `IAPIConnector`
      Parameters:
        `path` - - String
        `data` - - String
      Returns:
        the response in a stream
      Throws:
        `ConnectionException` - if any connection problems occur

    - #### getLastPath

          public String getLastPath()

    - #### getLastData

          public String getLastData()

    - #### beginRequest

          public OutputStream beginRequest(String path,
                                           String contentType)

      Operation not supported
      Specified by:
        `beginRequest` in interface `IAPIConnector`
      Parameters:
        `path` - path to the data on server
        `contentType` - Content-type of HTTP header
      Returns:
        the stream for writing data

    - #### endRequest

          public InputStream endRequest(String path)

      Operation not supported
      Specified by:
        `endRequest` in interface `IAPIConnector`
      Parameters:
        `path` - path to the data on server
      Returns:
        the stream for reading data

Copyright © 2016 VersionOne, Inc.. All rights reserved.