public final class

BoxHTTPManager

extends Object
java.lang.Object
   ↳ cn.com.believer.songyuanframework.openapi.storage.box.impl.simple.core.BoxHTTPManager

Summary

Fields
protected static final Logger LOGGER log4j object.
private Properties config config properties.
private HttpClient hc only one instance in this application.
private static BoxHTTPManager instance singleton instance.
Public Methods
Document doGet(String url)
http get method, get a XML result.
byte[] doGetByteArry(String url)
post to server and get byte array.
File doGetFile(String url, File inFile)
download as a file object.
String doMultipartPost(String url, List fileList)
upload multiple files.
String doMultipartPost(String url, Map filesHashMap)
upload multiple files.
String doPost(String url, String postData)
post data to gateway.
String doPostXML(String url, String postData)
post XML content to the server.
static BoxHTTPManager getBoxHTTPManager()
get the only one manager.
Properties getConfig()
HttpClient getHttpClient()
get the only http client instance of system, config it as what you want.
void setConfig(Properties config)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected static final Logger LOGGER

log4j object.

private Properties config

config properties.

private HttpClient hc

only one instance in this application.

private static BoxHTTPManager instance

singleton instance.

Public Methods

public Document doGet (String url)

http get method, get a XML result.

Parameters
url Http URL
Returns
  • XML result
Throws
IOException io exception
DocumentException document exception

public byte[] doGetByteArry (String url)

post to server and get byte array.

Parameters
url Server URL
Returns
  • byte array.
Throws
IOException IO exception

public File doGetFile (String url, File inFile)

download as a file object.

Parameters
url Server URL
inFile Input file object
Returns
  • output file object
Throws
IOException IO exception

public String doMultipartPost (String url, List fileList)

upload multiple files.

Parameters
url Http URL
fileList File list(File list)
Returns
  • response
Throws
IOException exception

public String doMultipartPost (String url, Map filesHashMap)

upload multiple files.

Parameters
url Http URL
filesHashMap Hashmap, key is string(file name), value is byte array.
Returns
  • response
Throws
IOException exception

public String doPost (String url, String postData)

post data to gateway.

Parameters
url Http URL
postData String of json
Returns
  • string response
Throws
IOException IOException

public String doPostXML (String url, String postData)

post XML content to the server.

Parameters
url Server URL
postData XML string
Returns
  • result from server
Throws
IOException IO exception

public static BoxHTTPManager getBoxHTTPManager ()

get the only one manager.

Returns
  • XDriveHTTPManager

public Properties getConfig ()

Returns
  • the config

public HttpClient getHttpClient ()

get the only http client instance of system, config it as what you want.

Returns
  • the hc

public void setConfig (Properties config)

Parameters
config The config to set