Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit c2d3eac

Browse files
committed
chore(maintenance): fixed doclint complaints
2 parents 5726f43 + 9a7aaab commit c2d3eac

23 files changed

+1238
-1436
lines changed

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ dependencies {
1111
compile "commons-codec:commons-codec:1.9"
1212
compile "commons-lang:commons-lang:2.6"
1313
compile "commons-logging:commons-logging:1.2"
14-
compile "org.apache.httpcomponents:httpcore:4.3.2"
15-
compile "org.apache.httpcomponents:httpmime:4.3.5"
16-
compile "org.apache.httpcomponents:httpclient:4.3.5"
14+
compile "org.apache.httpcomponents:httpcore:4.4.4"
15+
compile "org.apache.httpcomponents:httpmime:4.5.2"
16+
compile "org.apache.httpcomponents:httpclient:4.5.2"
1717
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.3'
1818
compile 'com.fasterxml.jackson.core:jackson-core:2.2.3'
1919
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.3'
@@ -22,7 +22,7 @@ dependencies {
2222

2323
jar {
2424
baseName = 'jDeployR'
25-
version = '8.0.0'
25+
version = '8.0.5'
2626
}
2727

2828
javadoc {

examples/tutorial/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'application'
44
sourceCompatibility = "1.6"
55
targetCompatibility = "1.6"
66

7-
applicationDefaultJvmArgs = ["-Dendpoint=http://localhost:8000/deployr",
7+
applicationDefaultJvmArgs = ["-Dendpoint=http://localhost:8050/deployr",
88
"-Dusername=testuser",
99
"-Dpassword=ADD_TESTUSER_PASSWORD"]
1010

@@ -17,9 +17,9 @@ dependencies {
1717
compile "commons-codec:commons-codec:1.9"
1818
compile "commons-lang:commons-lang:2.6"
1919
compile "commons-logging:commons-logging:1.2"
20-
compile "org.apache.httpcomponents:httpcore:4.3.2"
21-
compile "org.apache.httpcomponents:httpmime:4.3.5"
22-
compile "org.apache.httpcomponents:httpclient:4.3.5"
20+
compile "org.apache.httpcomponents:httpcore:4.4.4"
21+
compile "org.apache.httpcomponents:httpmime:4.5.2"
22+
compile "org.apache.httpcomponents:httpclient:4.5.2"
2323
compile 'com.fasterxml.jackson.core:jackson-databind:2.2.3'
2424
compile 'com.fasterxml.jackson.core:jackson-core:2.2.3'
2525
compile 'com.fasterxml.jackson.core:jackson-annotations:2.2.3'
@@ -28,7 +28,7 @@ dependencies {
2828

2929
jar {
3030
baseName = 'client-tutorial'
31-
version = '8.0.0'
31+
version = '8.0.5'
3232
}
3333

3434
task execute(type: JavaExec) {

src/main/java/com/revo/deployr/client/RClient.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -197,27 +197,6 @@ public URL renderScript(String scriptName,
197197
throws RClientException,
198198
RDataException;
199199

200-
/**
201-
* Execute a repository-managed shell script. Execution occurs on the
202-
* DeployR server. The response captures the line-by-line console output
203-
* generated by the execution of the shell script on the server.
204-
* Only shell scripts created by an ADMIN user on the DeployR server
205-
* can be executed on this call. All attempts to execute shell scripts
206-
* not created by an ADMIN user will be rejected. Access to shell
207-
* scripts is also governed by standard repository access controls.
208-
* <p>
209-
* @throws RClientException if RClient fails to complete call.
210-
* @throws RSecurityException if DeployR server security conditions not met on call.
211-
*/
212-
public List<String> executeShell(String shellName,
213-
String shellDirectory,
214-
String shellAuthor,
215-
String shellVersion,
216-
String args)
217-
throws RClientException,
218-
RSecurityException,
219-
RDataException;
220-
221200
/**
222201
* Interrupts the current execution on the HTTP blackbox project associated
223202
* with the current HTTP session.

src/main/java/com/revo/deployr/client/about/RRepositoryFileDetails.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public RRepositoryFileDetails(String filename, String directory,
3030
String restricted, boolean shared, boolean published,
3131
List<String> authors, String inputs, String outputs,
3232
String tags, RRepositoryFile.Category category,
33-
String md5, Date lastModified) {
33+
String sha256, Date lastModified) {
3434
this.filename = filename;
3535
this.directory = directory;
3636
this.author = author;
@@ -48,7 +48,8 @@ public RRepositoryFileDetails(String filename, String directory,
4848
this.outputs = outputs;
4949
this.tags = tags;
5050
this.category = category;
51-
this.md5 = md5;
51+
this.sha256 = sha256;
52+
this.md5 = this.sha256; // @deprecated - as of 8.0.5 server, use sha256
5253
this.lastModified = lastModified;
5354
this.url = url;
5455
}
@@ -142,8 +143,14 @@ public RRepositoryFileDetails(String filename, String directory,
142143
*/
143144
public final RRepositoryFile.Category category;
144145

146+
/**
147+
* Repository file 256 checksum.
148+
*/
149+
public final String sha256;
150+
145151
/**
146152
* Repository file md5 checksum.
153+
* @deprecated As of release 8.0.5 server, replaced by {@link #sha256}
147154
*/
148155
public final String md5;
149156

@@ -156,6 +163,4 @@ public RRepositoryFileDetails(String filename, String directory,
156163
* Repository file url.
157164
*/
158165
public final URL url;
159-
160-
161166
}

src/main/java/com/revo/deployr/client/about/RUserDetails.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@
1818

1919
public class RUserDetails {
2020

21-
public RUserDetails(String username, String displayname, String cookie, RUserLimitDetails limits) {
21+
public RUserDetails(String username,
22+
String displayname,
23+
String cookie,
24+
String csrf,
25+
RUserLimitDetails limits) {
2226

2327
this.username = username;
2428
this.displayname = displayname;
2529
this.cookie = cookie;
30+
this.csrf = csrf;
2631
this.limits = limits;
2732
}
2833

@@ -45,4 +50,9 @@ public RUserDetails(String username, String displayname, String cookie, RUserLim
4550
* About limits for currently authenticated user.
4651
*/
4752
public final RUserLimitDetails limits;
53+
54+
/**
55+
* The `X_CSRF_TOKEN` value.
56+
*/
57+
public final String csrf;
4858
}

src/main/java/com/revo/deployr/client/call/AbstractCall.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ public abstract class AbstractCall implements RCall, RCoreResponse {
5151
protected HttpClient httpClient;
5252
protected String serverUrl;
5353
protected Future future;
54-
protected HttpUriRequest httpUriRequest;
55-
56-
54+
protected HttpUriRequest httpUriRequest;
5755
protected Map<String, String> httpParams = new HashMap();
56+
protected Map<String, String> httpHeaders = new HashMap();
5857

5958
/**
6059
* Method, internal use only.
@@ -118,6 +117,12 @@ public boolean isCompleted() {
118117
return future.isDone();
119118
}
120119

120+
public void addHeader(String name, String value) {
121+
if (value != null) {
122+
httpHeaders.put(name, value);
123+
}
124+
}
125+
121126
/*
122127
* Protected implementation making HTTP Request.
123128
*/
@@ -164,17 +169,18 @@ protected RCoreResult makeRequest(HttpUriRequest httpUriRequest, String API) {
164169
RCoreResultImpl pResult = null;
165170

166171
try {
172+
// set any custom headers on the request
173+
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
174+
httpUriRequest.addHeader(entry.getKey(), entry.getValue());
175+
}
167176

168177
HttpResponse response = httpClient.execute(this.httpUriRequest);
169178
StatusLine statusLine = response.getStatusLine();
170179

171180
HttpEntity responseEntity = response.getEntity();
172181
String markup = EntityUtils.toString(responseEntity);
173-
174-
pResult = new RCoreResultImpl();
175-
176-
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());
177-
182+
pResult = new RCoreResultImpl(response.getAllHeaders());
183+
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());
178184
} catch (UnsupportedEncodingException ueex) {
179185
log.warn("AbstractCall: makeRequest unsupported encoding exception=" + ueex);
180186
} catch (IOException ioex) {

src/main/java/com/revo/deployr/client/call/project/ProjectDirectoryUploadCall.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.nio.charset.Charset;
3838
import java.util.ArrayList;
3939
import java.util.List;
40+
import java.util.Map;
4041
import java.util.concurrent.Callable;
4142

4243
/**
@@ -72,7 +73,7 @@ public RCoreResult call() {
7273
try {
7374

7475
HttpPost httpPost = new HttpPost(serverUrl + API);
75-
super.httpUriRequest = httpPost;
76+
super.httpUriRequest = httpPost;
7677

7778
List<NameValuePair> postParams = new ArrayList<NameValuePair>();
7879
postParams.add(new BasicNameValuePair("format", "json"));
@@ -91,12 +92,17 @@ public RCoreResult call() {
9192

9293
httpPost.setEntity(entity);
9394

95+
// set any custom headers on the request
96+
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
97+
httpPost.addHeader(entry.getKey(), entry.getValue());
98+
}
99+
94100
HttpResponse response = httpClient.execute(httpPost);
95101
StatusLine statusLine = response.getStatusLine();
96102
HttpEntity responseEntity = response.getEntity();
97103
String markup = EntityUtils.toString(responseEntity);
98-
99-
pResult = new RCoreResultImpl();
104+
105+
pResult = new RCoreResultImpl(response.getAllHeaders());
100106
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());
101107

102108
} catch (UnsupportedEncodingException ueex) {

src/main/java/com/revo/deployr/client/call/project/ProjectImportCall.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.nio.charset.Charset;
3737
import java.util.ArrayList;
3838
import java.util.List;
39+
import java.util.Map;
3940
import java.util.concurrent.Callable;
4041

4142
/**
@@ -83,12 +84,17 @@ public RCoreResult call() {
8384

8485
httpPost.setEntity(entity);
8586

87+
// set any custom headers on the request
88+
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
89+
httpPost.addHeader(entry.getKey(), entry.getValue());
90+
}
91+
8692
HttpResponse response = httpClient.execute(httpPost);
8793
StatusLine statusLine = response.getStatusLine();
8894
HttpEntity responseEntity = response.getEntity();
8995
String markup = EntityUtils.toString(responseEntity);
90-
91-
pResult = new RCoreResultImpl();
96+
97+
pResult = new RCoreResultImpl(response.getAllHeaders());
9298
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());
9399

94100
} catch (UnsupportedEncodingException ueex) {

src/main/java/com/revo/deployr/client/call/project/ProjectWorkspaceUploadCall.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.nio.charset.Charset;
3737
import java.util.ArrayList;
3838
import java.util.List;
39+
import java.util.Map;
3940
import java.util.concurrent.Callable;
4041

4142
/**
@@ -86,12 +87,17 @@ public RCoreResult call() {
8687

8788
httpPost.setEntity(entity);
8889

90+
// set any custom headers on the request
91+
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
92+
httpPost.addHeader(entry.getKey(), entry.getValue());
93+
}
94+
8995
HttpResponse response = httpClient.execute(httpPost);
9096
StatusLine statusLine = response.getStatusLine();
9197
HttpEntity responseEntity = response.getEntity();
9298
String markup = EntityUtils.toString(responseEntity);
9399

94-
pResult = new RCoreResultImpl();
100+
pResult = new RCoreResultImpl(response.getAllHeaders());
95101
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());
96102

97103
} catch (UnsupportedEncodingException ueex) {

src/main/java/com/revo/deployr/client/call/repository/RepositoryDirectoryUploadCall.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.nio.charset.Charset;
3838
import java.util.ArrayList;
3939
import java.util.List;
40+
import java.util.Map;
4041
import java.util.concurrent.Callable;
4142

4243
/**
@@ -96,12 +97,17 @@ public RCoreResult call() {
9697

9798
httpPost.setEntity(entity);
9899

100+
// set any custom headers on the request
101+
for (Map.Entry<String, String> entry : httpHeaders.entrySet()) {
102+
httpPost.addHeader(entry.getKey(), entry.getValue());
103+
}
104+
99105
HttpResponse response = httpClient.execute(httpPost);
100106
StatusLine statusLine = response.getStatusLine();
101107
HttpEntity responseEntity = response.getEntity();
102108
String markup = EntityUtils.toString(responseEntity);
103109

104-
pResult = new RCoreResultImpl();
110+
pResult = new RCoreResultImpl(response.getAllHeaders());
105111
pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase());
106112

107113
} catch (UnsupportedEncodingException ueex) {

0 commit comments

Comments
 (0)