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

Commit b69f45f

Browse files
author
Corneil du Plessis
authored
Improve formatting (#4970)
* Improve error handling on failed post to http. * Consistent formatting
1 parent b051232 commit b69f45f

File tree

3 files changed

+317
-315
lines changed

3 files changed

+317
-315
lines changed

spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/RuntimeOperations.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ public interface RuntimeOperations {
5353
/**
5454
* Access an HTTP GET exposed actuator resource for a deployed app instance.
5555
*
56-
* @param appId the application id
56+
* @param appId the application id
5757
* @param instanceId the application instance id
58-
* @param endpoint the relative actuator path, e.g., {@code /info}
58+
* @param endpoint the relative actuator path, e.g., {@code /info}
5959
* @return the contents as JSON text
6060
*/
6161
String getFromActuator(String appId, String instanceId, String endpoint);
6262

6363
/**
6464
* Access an HTTP POST exposed actuator resource for a deployed app instance.
6565
*
66-
* @param appId the application id
66+
* @param appId the application id
6767
* @param instanceId the application instance id
68-
* @param endpoint the relative actuator path, e.g., {@code /info}
69-
* @param data map representing the data to post on request body
68+
* @param endpoint the relative actuator path, e.g., {@code /info}
69+
* @param data map representing the data to post on request body
7070
*/
7171
Object postToActuator(String appId, String instanceId, String endpoint, Map<String, Object> data);
7272

@@ -77,7 +77,7 @@ public interface RuntimeOperations {
7777
* @param instanceId the application instance id
7878
* @param data data to send to url. The mimetype should be in the Content-Type header if important.
7979
* @param headers post request headers.
80-
* This method will return an exception
80+
* This method will return an exception
8181
*/
8282
void postToUrl(String appId, String instanceId, byte[] data, HttpHeaders headers);
8383
}

spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/RuntimeTemplate.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private Link getLink(String relationPath, RepresentationModel<?> resources, bool
8686
}
8787
return link.orElse(null);
8888
}
89-
89+
9090
@Override
9191
public PagedModel<AppStatusResource> status() {
9292
String uriTemplate = this.appStatusesUriTemplate.expand().getHref();
@@ -133,7 +133,8 @@ public void postToUrl(String appId, String instanceId, byte[] data, HttpHeaders
133133
String uri = appUrlPostUriTemplate.expand(appId, instanceId).getHref();
134134
HttpEntity<byte[]> entity = new HttpEntity<>(data, headers);
135135
ResponseEntity<String> response = this.restTemplate.exchange(uri, HttpMethod.POST, entity, String.class);
136-
if(!response.getStatusCode().is2xxSuccessful()) {
136+
137+
if (!response.getStatusCode().is2xxSuccessful()) {
137138
throw new RuntimeException("POST:exception:" + response.getStatusCode() + ":" + response.getBody());
138139
}
139140
}

0 commit comments

Comments
 (0)