# Class URL.URLConnection

java.lang.Object
com.codename1.io.URL.URLConnection

Direct Known Subclasses:
  `URL.HttpURLConnection`

Enclosing class:
  `URL`

public abstract class URL.URLConnection extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `URLConnection()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract void`
  `connect()`
  `int`
  `getConnectTimeout()`
  `abstract int`
  `getContentLength()`
  `long`
  `getContentLengthLong()`
  `abstract String`
  `getContentType()`
  `boolean`
  `getDoInput()`
  `boolean`
  `getDoOutput()`
  `abstract String`
  `getHeaderField(String s)`
  `abstract Map<String, List<String>>`
  `getHeaderFields()`
  `abstract InputStream`
  `getInputStream()`
  `abstract OutputStream`
  `getOutputStream()`
  `int`
  `getReadTimeout()`
  `URL`
  `getURL()`
  `void`
  `setConnectTimeout(int connectTimeout)`
  `void`
  `setDoInput(boolean i)`
  `void`
  `setDoOutput(boolean i)`
  `void`
  `setReadTimeout(int readTimeout)`
  `void`
  `setRequestProperty(String key, String value)`
  Sets the request property, replacing existing property with same key, if it already exists.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### URLConnection

    public URLConnection()

- ## Method Details

  - ### connect

    public abstract void connect() throws IOException
    Throws:
      `IOException`

  - ### getConnectTimeout

    public int getConnectTimeout()

  - ### setConnectTimeout

    public void setConnectTimeout(int connectTimeout)

  - ### getReadTimeout

    public int getReadTimeout()

  - ### setReadTimeout

    public void setReadTimeout(int readTimeout)

  - ### getURL

    public URL getURL()

  - ### getContentLength

    public abstract int getContentLength()

  - ### getContentLengthLong

    public long getContentLengthLong()

  - ### getContentType

    public abstract String getContentType()

  - ### getHeaderField

    public abstract String getHeaderField(String s)

  - ### getHeaderFields

    public abstract Map<String, List<String>> getHeaderFields()

  - ### getInputStream

    public abstract InputStream getInputStream() throws IOException
    Throws:
      `IOException`

  - ### getOutputStream

    public abstract OutputStream getOutputStream() throws IOException
    Throws:
      `IOException`

  - ### setRequestProperty

    public void setRequestProperty(String key, String value)

    Sets the request property, replacing existing property with same key, if it already exists.

    ###### Parameters

    - `key`: The key of the request property.

    - `value`: The value of the request property.

  - ### getDoInput

    public boolean getDoInput()

  - ### setDoInput

    public void setDoInput(boolean i)

  - ### getDoOutput

    public boolean getDoOutput()

  - ### setDoOutput

    public void setDoOutput(boolean i)