com.versionone.apiclient

## Class V1APIConnector

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

- All Implemented Interfaces:
    IAPIConnector

  Deprecated.
  This class has been deprecated. Please use V1Connector instead.

      @Deprecated
      public class V1APIConnector
      extends Object
      implements IAPIConnector

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `Map<String,String>` | `customHttpHeaders` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `V1APIConnector(String url)` Deprecated. Create a connection with only the URL to the VersionOne server.
    `V1APIConnector(String url, ProxyProvider proxy)` Deprecated. Create a connection with only the URL to the VersionOne server through a proxy.
    `V1APIConnector(String url, String userName, String password)` Deprecated. Create a connection using a username and password.
    `V1APIConnector(String url, String userName, String password, ProxyProvider proxy)` Deprecated. Create a connection using username and password through a proxy.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `OutputStream` | `beginRequest(String path, String contentType)` Deprecated. Beginning HTTP POST request to the server.
    `InputStream` | `endRequest(String path)` Deprecated. Complete the HTTP request and get a response.
    `InputStream` | `getAttachment(String attachmentKey)` Deprecated. Read data from the path provided Note: Caller is responsible for closing the returned stream
    `ICookiesManager` | `getCookiesJar()` Deprecated. Returns a cookies jar.
    `Reader` | `getData()` Deprecated. Read data from the root of the connection.
    `Reader` | `getData(String path)` Deprecated. Read data from the path provided.
    `String` | `getUserAgentHeader()` Deprecated. Get the value for the user-agent header.
    `Reader` | `sendData(String path, String data)` Deprecated. Send data to the path.
    `void` | `setUserAgentHeader(String name, String version)` Deprecated. Set a value for custom the user-agent header.

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

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

- - ### Field Detail

    - #### customHttpHeaders

          public final Map<String,String> customHttpHeaders

      Deprecated.

  - ### Constructor Detail

    - #### V1APIConnector

          public V1APIConnector(String url)

      Deprecated.
      Create a connection with only the URL to the VersionOne server. Use this constructor to access the VersionOne Meta API, which does not require the use of credentials.
      Parameters:
        `url` - URL of the VersionOne server

    - #### V1APIConnector

          public V1APIConnector(String url,
                                ProxyProvider proxy)

      Deprecated.
      Create a connection with only the URL to the VersionOne server through a proxy. Use this constructor to access the VersionOne Meta API, which does not require the use of credentials.
      Parameters:
        `url` - URL to the VersionOne server
        `proxy` - Proxy for the connection

    - #### V1APIConnector

          public V1APIConnector(String url,
                                String userName,
                                String password)

      Deprecated.
      Create a connection using a username and password. When using for Windows Integrated Authentication, pass null for the username and password. The SDK will use the currently logged in user's credentials.
      Parameters:
        `url` - URL of the VersionOne server
        `userName` - VersionOne username
        `password` - VersionOne password

    - #### V1APIConnector

          public V1APIConnector(String url,
                                String userName,
                                String password,
                                ProxyProvider proxy)

      Deprecated.
      Create a connection using username and password through a proxy. When using for Windows Integrated Authentication, pass null for the password. The SDK will use the currently logged in user's credentials.
      Parameters:
        `url` - URL of the VersionOne server
        `userName` - VersionOne username
        `password` - VersionOne password
        `proxy` - Proxy for the connection

  - ### Method Detail

    - #### setUserAgentHeader

          public void setUserAgentHeader(String name,
                                         String version)

      Deprecated.
      Set a value for custom the user-agent header.
      Parameters:
        `name` - String
        `version` - String

    - #### getUserAgentHeader

          public String getUserAgentHeader()

      Deprecated.
      Get the value for the user-agent header.
      Returns:
        String

    - #### getCookiesJar

          public ICookiesManager getCookiesJar()

      Deprecated.
      Returns a cookies jar.
      Returns:
        ICookiesManager

    - #### getData

          public Reader getData()
                         throws ConnectionException

      Deprecated.
      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` - - ConnectionException

    - #### getData

          public Reader getData(String path)
                         throws ConnectionException

      Deprecated.
      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:
        The stream for reading data.
      Throws:
        `ConnectionException` - - ConnectionException

    - #### getAttachment

          public InputStream getAttachment(String attachmentKey)
                                    throws ConnectionException

      Deprecated.
      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

      Deprecated.
      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` - - ConnectionException

    - #### beginRequest

          public OutputStream beginRequest(String path,
                                           String contentType)
                                    throws ConnectionException

      Deprecated.
      Beginning HTTP POST request to the server. To begin POST request contentType parameter must be defined. If contentType parameter is null, GET request used. It's obligatory to complete request and get response by `endRequest(String)` method with the same path parameter.
      Specified by:
        `beginRequest` in interface `IAPIConnector`
      Parameters:
        `path` - Path to the data on server.
        `contentType` - Content-type of output content. If null - GET request used.
      Returns:
        the stream for writing POST data.
      Throws:
        `ConnectionException` - if any connection problems occur
      See Also:
        `endRequest(String)`

    - #### endRequest

          public InputStream endRequest(String path)
                                 throws ConnectionException

      Deprecated.
      Complete the HTTP request and get a response.
      Specified by:
        `endRequest` in interface `IAPIConnector`
      Parameters:
        `path` - Path to the data on server.
      Returns:
        The response stream for reading data.
      Throws:
        `ConnectionException` - if any connection problems occur
      See Also:
        `beginRequest(String, String)`

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