Package org.gitana.platform.client.support

# Class RemoteImpl

java.lang.Object
org.gitana.platform.client.support.RemoteImpl

All Implemented Interfaces:
  `Remote`

public class RemoteImpl extends Object implements Remote

Author:
  uzi

## Constructor Summary

Constructors
Constructor
Description
`RemoteImpl(org.apache.http.client.HttpClient client, String remoteURL)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addCookie(org.apache.http.cookie.Cookie cookie)`
`void`
`addHeader(String name, String value)`
`Response`
`delete(String uri)`
`org.apache.http.HttpResponse`
`download(String uri)`
`byte[]`
`downloadBytes(String uri)`
`Response`
`get(String uri)`
`Response`
`get(String uri, Map<String,String> params)`
`org.apache.http.HttpResponse`
`getEx(String uri)`
`org.gitana.http.HttpMethodExecutor`
`getHttpMethodExecutor()`
`boolean`
`getPaths()`
`String`
`getRemoteURL()`
`String`
`getString(String uri, Map<String,String> params)`
`Response`
`post(String uri)`
`Response`
`post(String uri, byte[] bytes, String mimetype)`
`Response`
`post(String uri, com.fasterxml.jackson.databind.node.ObjectNode object)`
`Response`
`post(String uri, InputStream in, long length, String mimetype)`
`Response`
`post(String uri, Map<String,String> params)`
`Response`
`post(String uri, Map<String,String> params, byte[] bytes, String mimetype)`
`Response`
`post(String uri, Map<String,String> params, com.fasterxml.jackson.databind.node.ObjectNode object)`
`Response`
`post(String uri, Map<String,String> params, com.fasterxml.jackson.databind.node.ObjectNode object, org.gitana.http.HttpPayload payload)`
Performs a multipart post.
`Response`
`post(String uri, Map<String,String> params, InputStream in, long length, String mimetype)`
`org.apache.http.HttpResponse`
`postData(String uri, InputStream in, long length, String mimetype)`
`org.apache.http.HttpResponse`
`postEx(String uri)`
`Response`
`put(String uri)`
`Response`
`put(String uri, byte[] bytes, String mimetype)`
`Response`
`put(String uri, com.fasterxml.jackson.databind.node.ObjectNode object)`
`Response`
`put(String uri, InputStream in, long length, String mimetype)`
`Response`
`put(String uri, Map<String,String> params)`
`Response`
`put(String uri, Map<String,String> params, byte[] bytes, String mimetype)`
`Response`
`put(String uri, Map<String,String> params, com.fasterxml.jackson.databind.node.ObjectNode object)`
`Response`
`put(String uri, Map<String,String> params, com.fasterxml.jackson.databind.node.ObjectNode object, org.gitana.http.HttpPayload payload)`
Performs a multipart put.
`Response`
`put(String uri, Map<String,String> params, InputStream in, long length, String mimetype)`
`void`
`setFull(boolean full)`
`void`
`setHeaders(Map<String,String> headers)`
`void`
`setHttpMethodExecutor(org.gitana.http.HttpMethodExecutor httpMethodExecutor)`
`void`
`setLocale(Locale locale)`
`void`
`setMetadata(boolean metadata)`
`void`
`setPaths(boolean paths)`
`void`
`upload(String uri, byte[] bytes, String mimetype)`
`void`
`upload(String uri, byte[] bytes, String mimetype, String filename)`
`void`
`upload(String uri, InputStream in, long length, String mimetype)`
`void`
`upload(String uri, InputStream in, long length, String mimetype, String filename)`
`Response`
`upload(String uri, Map<String,String> params, org.gitana.http.HttpPayload... payloads)`
`Response`
`upload(String uri, org.gitana.http.HttpPayload... payloads)`

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

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

## Constructor Details

### RemoteImpl

public RemoteImpl(org.apache.http.client.HttpClient client, String remoteURL)

## Method Details

### setHttpMethodExecutor

public void setHttpMethodExecutor(org.gitana.http.HttpMethodExecutor httpMethodExecutor)

### getHttpMethodExecutor

public org.gitana.http.HttpMethodExecutor getHttpMethodExecutor()

### addCookie

public void addCookie(org.apache.http.cookie.Cookie cookie)

Specified by:
  `addCookie` in interface `Remote`

### getRemoteURL

public String getRemoteURL()

### setFull

public void setFull(boolean full)

### setMetadata

public void setMetadata(boolean metadata)

### setPaths

public void setPaths(boolean paths)

### getPaths

public boolean getPaths()

### setLocale

public void setLocale(Locale locale)

### addHeader

public void addHeader(String name, String value)

Specified by:
  `addHeader` in interface `Remote`

### setHeaders

public void setHeaders(Map<String,String> headers)

Specified by:
  `setHeaders` in interface `Remote`

### get

public Response get(String uri)

Specified by:
  `get` in interface `Remote`

### get

public Response get(String uri, Map<String,String> params)

Specified by:
  `get` in interface `Remote`

### getString

public String getString(String uri, Map<String,String> params)

Specified by:
  `getString` in interface `Remote`

### delete

public Response delete(String uri)

Specified by:
  `delete` in interface `Remote`

### post

public Response post(String uri)

Specified by:
  `post` in interface `Remote`

### post

public Response post(String uri, Map<String,String> params)

Specified by:
  `post` in interface `Remote`

### post

public Response post(String uri, com.fasterxml.jackson.databind.node.ObjectNode object)

Specified by:
  `post` in interface `Remote`

### post

public Response post(String uri, Map<String,String> params, com.fasterxml.jackson.databind.node.ObjectNode object)

Specified by:
  `post` in interface `Remote`

### post

public Response post(String uri, byte[] bytes, String mimetype)

Specified by:
  `post` in interface `Remote`

### post

public Response post(String uri, Map<String,String> params, byte[] bytes, String mimetype)

Specified by:
  `post` in interface `Remote`

### post

public Response post(String uri, InputStream in, long length, String mimetype)

Specified by:
  `post` in interface `Remote`

### post

public Response post(String uri, Map<String,String> params, InputStream in, long length, String mimetype)

Specified by:
  `post` in interface `Remote`

### postData

public org.apache.http.HttpResponse postData(String uri, InputStream in, long length, String mimetype)

Specified by:
  `postData` in interface `Remote`

### getEx

public org.apache.http.HttpResponse getEx(String uri)

Specified by:
  `getEx` in interface `Remote`

### postEx

public org.apache.http.HttpResponse postEx(String uri)

Specified by:
  `postEx` in interface `Remote`

### post

public Response post(String uri, Map<String,String> params, com.fasterxml.jackson.databind.node.ObjectNode object, org.gitana.http.HttpPayload payload)
Description copied from interface: `Remote`
Performs a multipart post.

Specified by:
  `post` in interface `Remote`
Parameters:
  `uri` -
  `params` -
  `object` -
  `payload` -
Returns:

### put

public Response put(String uri)

Specified by:
  `put` in interface `Remote`

### put

public Response put(String uri, Map<String,String> params)

Specified by:
  `put` in interface `Remote`

### put

public Response put(String uri, com.fasterxml.jackson.databind.node.ObjectNode object)

Specified by:
  `put` in interface `Remote`

### put

public Response put(String uri, Map<String,String> params, com.fasterxml.jackson.databind.node.ObjectNode object)

Specified by:
  `put` in interface `Remote`

### put

public Response put(String uri, byte[] bytes, String mimetype)

Specified by:
  `put` in interface `Remote`

### put

public Response put(String uri, Map<String,String> params, byte[] bytes, String mimetype)

Specified by:
  `put` in interface `Remote`

### put

public Response put(String uri, InputStream in, long length, String mimetype)

Specified by:
  `put` in interface `Remote`

### put

public Response put(String uri, Map<String,String> params, InputStream in, long length, String mimetype)

Specified by:
  `put` in interface `Remote`

### put

public Response put(String uri, Map<String,String> params, com.fasterxml.jackson.databind.node.ObjectNode object, org.gitana.http.HttpPayload payload)
Description copied from interface: `Remote`
Performs a multipart put.

Specified by:
  `put` in interface `Remote`
Parameters:
  `uri` -
  `params` -
  `object` -
  `payload` -
Returns:

### upload

public void upload(String uri, byte[] bytes, String mimetype) throws Exception

Specified by:
  `upload` in interface `Remote`
Throws:
  `Exception`

### upload

public void upload(String uri, byte[] bytes, String mimetype, String filename) throws Exception

Specified by:
  `upload` in interface `Remote`
Throws:
  `Exception`

### upload

public void upload(String uri, InputStream in, long length, String mimetype) throws Exception

Specified by:
  `upload` in interface `Remote`
Throws:
  `Exception`

### upload

public void upload(String uri, InputStream in, long length, String mimetype, String filename) throws Exception

Specified by:
  `upload` in interface `Remote`
Throws:
  `Exception`

### upload

public Response upload(String uri, org.gitana.http.HttpPayload... payloads) throws Exception

Specified by:
  `upload` in interface `Remote`
Throws:
  `Exception`

### upload

public Response upload(String uri, Map<String,String> params, org.gitana.http.HttpPayload... payloads) throws Exception

Specified by:
  `upload` in interface `Remote`
Throws:
  `Exception`

### downloadBytes

public byte[] downloadBytes(String uri) throws Exception

Specified by:
  `downloadBytes` in interface `Remote`
Throws:
  `Exception`

### download

public org.apache.http.HttpResponse download(String uri) throws Exception

Specified by:
  `download` in interface `Remote`
Throws:
  `Exception`