# Class: com.pnfsoftware.jeb.util.net.Net

A network object used to download from and upload to http/https URLs, with socks and http proxy support.

## Constructor: Net

Description: Create a standard Net object, using global proxy settings set using [#setGlobalProxyInformation(NetProxyInfo)](#setGlobalProxyInformation(NetProxyInfo)). The user\-agent is set to "PNF Software UP"; the timeouts are set to 30 seconds for connect, 120 seconds for read, 60 seconds for write; redirects are followed.

## Constructor: Net
- parameter: `net0`, type: `com.pnfsoftware.jeb.util.net.Net`

Description: Copy constructor.
parameter: net0: an existing net object

## Method: buildClient
- parameter: `url`, type: `java.lang.String`
- return type: `okhttp3.OkHttpClient`

Description: 
parameter: url: optional but recommended if a proxy is in place
return: an HTTP client configured with this instance's settings

## Method: buildClient
- parameter: `url`, type: `java.lang.String`
- parameter: `progressCallback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- return type: `okhttp3.OkHttpClient`

Description: 
parameter: url: optional but recommended if a proxy is in place
parameter: progressCallback: optional
return: an HTTP client configured with this instance's settings

## Method: buildClient
- parameter: `url`, type: `java.lang.String`
- parameter: `progressCallback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- parameter: `timeouts`, type: `int[]`
- return type: `okhttp3.OkHttpClient`

Description: 
parameter: url: optional but recommended if a proxy is in place
parameter: progressCallback: optional
parameter: timeouts: optional \(if null, the object's timeouts are used\); else, a 3\-element array of            timeouts in ms: connect, read, write; when a timeout entry is specified, the value            0 means infinite \(do not time\-out\), and a negative value means use this object's            timeout
return: an HTTP client configured with this instance's settings

## Method: downloadBinary
- parameter: `dstfile`, type: `java.io.File`
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `progressCallback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- return type: `long`


## Method: duplicate
- return type: `com.pnfsoftware.jeb.util.net.INet`


## Method: getConnectTimeout
- return type: `int`


## Method: getProxyInformation
- return type: `com.pnfsoftware.jeb.util.net.NetProxyInfo`

Description: Get proxy information used by this instance.
return: optional proxy information

## Method: getReadTimeout
- return type: `int`


## Method: getSecureSocketInfo
- return type: `com.pnfsoftware.jeb.util.net.SecureSocketInfo`


## Method: getUserAgent
- return type: `java.lang.String`


## Method: getWriteTimeout
- return type: `int`


## Method: post
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `bodyParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`


## Method: post
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `bodyParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`


## Method: postMultipart
- parameter: `url`, type: `java.lang.String`
- parameter: `formParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `formFiles`, type: `java.util.Map<java.lang.String,com.pnfsoftware.jeb.util.net.FormFileEntry>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`


## Method: postMultipart
- parameter: `url`, type: `java.lang.String`
- parameter: `formParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `formFiles`, type: `java.util.Map<java.lang.String,com.pnfsoftware.jeb.util.net.FormFileEntry>`
- return type: `java.lang.String`


## Method: query
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`


## Method: query
- parameter: `url`, type: `java.lang.String`
- parameter: `parameters`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `java.lang.String`


## Method: query
- parameter: `url`, type: `java.lang.String`
- return type: `java.lang.String`


## Method: queryBinary
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `progressCallback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- return type: `byte[]`


## Method: queryBinary
- parameter: `url`, type: `java.lang.String`
- parameter: `urlParams`, type: `java.util.Map<java.lang.String,java.lang.String>`
- parameter: `serverHeaders`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `byte[]`


## Method: queryBinary
- parameter: `url`, type: `java.lang.String`
- parameter: `parameters`, type: `java.util.Map<java.lang.String,java.lang.String>`
- return type: `byte[]`


## Method: queryBinary
- parameter: `url`, type: `java.lang.String`
- return type: `byte[]`


## Method: setConnectTimeout
- parameter: `timeout`, type: `int`


## Method: setReadTimeout
- parameter: `timeout`, type: `int`


## Method: setSecureSocketInfo
- parameter: `info`, type: `com.pnfsoftware.jeb.util.net.SecureSocketInfo`


## Method: setUserAgent
- parameter: `userAgent`, type: `java.lang.String`


## Method: setWriteTimeout
- parameter: `timeout`, type: `int`


## Static Method: convertHttpDateToEpoch
- parameter: `dateString`, type: `java.lang.String`
- return type: `long`

Description: An HTTP Date.
parameter: dateString: HTTP date string
return: epoch in ms; 0 on error \(that is, Jan 1 1970\)

## Static Method: getGlobalProxyInformation
- return type: `com.pnfsoftware.jeb.util.net.NetProxyInfo`

Description: 
return: optional global proxy information

## Static Method: isConnectedToInternet
- return type: `boolean`

Description: Determine if the system appears to be connected to the Internet.
return: true or false

## Static Method: isConnectedToNetwork
- return type: `boolean`

Description: Determine if the system offers at least one active non\-loopback network interface. Careful\! This cannot be used to reliably find out if the system has an Internet connection.
return: true or false

## Static Method: setGlobalProxyInformation
- parameter: `proxyinfo`, type: `com.pnfsoftware.jeb.util.net.NetProxyInfo`

Description: Set global proxy information used by newly built clients.
parameter: proxyinfo: proxy information, or null for a direct connection

