Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

TABs removed.

  • Loading branch information...
commit d1b9e1f57f221d421ebd3564d1d1ca82eb569d52 1 parent 9edb6ed
@iced iced authored
Showing with 55 additions and 55 deletions.
  1. +55 −55 client/src/main/java/io/iron/ironworker/client/APIClient.java
View
110 client/src/main/java/io/iron/ironworker/client/APIClient.java
@@ -28,75 +28,75 @@
import java.util.Map;
public class APIClient {
- public static final String AWS_US_EAST_HOST = "worker-aws-us-east-1.iron.io";
-
- private String token;
- private String projectId;
- private String scheme;
- private String host;
- private int port;
- private int apiVersion;
+ public static final String AWS_US_EAST_HOST = "worker-aws-us-east-1.iron.io";
+
+ private String token;
+ private String projectId;
+ private String scheme;
+ private String host;
+ private int port;
+ private int apiVersion;
private String userAgent;
private int maxRetries;
- public APIClient(String token, String projectId) {
- this.token = token;
- this.projectId = projectId;
- this.scheme = "https";
- this.host = AWS_US_EAST_HOST;
- this.port = 443;
- this.apiVersion = 2;
+ public APIClient(String token, String projectId) {
+ this.token = token;
+ this.projectId = projectId;
+ this.scheme = "https";
+ this.host = AWS_US_EAST_HOST;
+ this.port = 443;
+ this.apiVersion = 2;
this.userAgent = "iron_worker_java-1.0.0";
maxRetries = 5;
- }
+ }
- public String getToken() {
- return token;
- }
+ public String getToken() {
+ return token;
+ }
- public void setToken(String token) {
- this.token = token;
- }
+ public void setToken(String token) {
+ this.token = token;
+ }
- public String getProjectId() {
- return projectId;
- }
+ public String getProjectId() {
+ return projectId;
+ }
- public void setProjectId(String projectId) {
- this.projectId = projectId;
- }
+ public void setProjectId(String projectId) {
+ this.projectId = projectId;
+ }
- public String getScheme() {
- return scheme;
- }
+ public String getScheme() {
+ return scheme;
+ }
- public void setScheme(String scheme) {
- this.scheme = scheme;
- }
+ public void setScheme(String scheme) {
+ this.scheme = scheme;
+ }
- public String getHost() {
- return host;
- }
+ public String getHost() {
+ return host;
+ }
- public void setHost(String host) {
- this.host = host;
- }
+ public void setHost(String host) {
+ this.host = host;
+ }
- public int getPort() {
- return port;
- }
+ public int getPort() {
+ return port;
+ }
- public void setPort(int port) {
- this.port = port;
- }
+ public void setPort(int port) {
+ this.port = port;
+ }
- public int getAPIVersion() {
- return apiVersion;
- }
+ public int getAPIVersion() {
+ return apiVersion;
+ }
- public void setAPIVersion(int apiVersion) {
- this.apiVersion = apiVersion;
- }
+ public void setAPIVersion(int apiVersion) {
+ this.apiVersion = apiVersion;
+ }
public String getUserAgent() {
return userAgent;
@@ -142,7 +142,7 @@ private HttpResponse doRequestExecute(HttpRequestBase request) {
return response;
}
- private HttpResponse doRequest(HttpRequestBase request, String method, Map<String, String> params) {
+ private HttpResponse doRequest(HttpRequestBase request, String method, Map<String, String> params) {
List<NameValuePair> qParams = new ArrayList<NameValuePair>();
if (params != null) {
@@ -166,12 +166,12 @@ private HttpResponse doRequest(HttpRequestBase request, String method, Map<Strin
request.setURI(uri);
- request.addHeader("Content-Type", "application/json");
+ request.addHeader("Content-Type", "application/json");
request.addHeader("Authorization", "OAuth " + token);
request.addHeader("User-Agent", userAgent);
return doRequestExecute(request);
- }
+ }
private HttpResponse doFileRequest(File file, String method, Map<String, String> params) {
URI uri = null;
Please sign in to comment.
Something went wrong with that request. Please try again.