PGBRequest.java
1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.http.impl.client.HttpClientBuilder
*/
package com.adobe.cq.mobile.phonegap.impl.build;
import com.adobe.cq.mobile.phonegap.impl.build.PGBuildUserAccount;
import org.apache.http.impl.client.HttpClientBuilder;
public class PGBRequest {
private static final int DEFAULT_PORT = 443;
private final boolean ssl;
private HttpClientBuilder httpClientBuilder = null;
private String host = null;
private int port = 443;
private PGBuildUserAccount pgBuildUserAccount = null;
public PGBRequest(HttpClientBuilder httpClientBuilder, String host, int port, PGBuildUserAccount pgBuildUserAccount, boolean ssl) {
this.httpClientBuilder = httpClientBuilder;
this.host = host;
this.port = port;
this.ssl = ssl;
this.pgBuildUserAccount = pgBuildUserAccount;
}
public HttpClientBuilder getHttpClientBuilder() {
return this.httpClientBuilder;
}
public String getHost() {
return this.host;
}
public int getPort() {
return this.port;
}
public String getUserId() {
return this.pgBuildUserAccount == null ? null : this.pgBuildUserAccount.getUserId();
}
public String getPassWord() {
return this.pgBuildUserAccount == null ? null : this.pgBuildUserAccount.getPassword();
}
public String getRootServiceURL() {
return (this.ssl ? "https" : "http") + "://" + this.host + ":" + this.port + "/api/v1";
}
public String getAppsServiceURL() {
return this.getRootServiceURL() + "/apps";
}
public String getAppURL(String appId) {
return this.getAppsServiceURL() + "/" + appId;
}
public String getAccountProfileURL() {
return this.getRootServiceURL() + "/me";
}
public String toString() {
return "PGBRequest{url='" + this.getRootServiceURL() + '\'' + ", userId='" + this.getUserId() + '\'' + ", passWord='" + "********" + '\'' + '}';
}
}