You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/09/30 16:02:47 UTC
[camel] 02/02: camel-platform-http-vertx: reformat
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch camel-3.4.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2c70250efd1e25cc8f96f528ba50b9fd701687fc
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Wed Sep 30 17:52:51 2020 +0200
camel-platform-http-vertx: reformat
---
.../services/org/apache/camel/other.properties | 2 +-
.../generated/resources/platform-http-vertx.json | 2 +-
.../http/vertx/VertxPlatformHttpConsumer.java | 81 +++++++++++-----------
3 files changed, 42 insertions(+), 43 deletions(-)
diff --git a/components/camel-platform-http-vertx/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-platform-http-vertx/src/generated/resources/META-INF/services/org/apache/camel/other.properties
index 64045fc..7829961 100644
--- a/components/camel-platform-http-vertx/src/generated/resources/META-INF/services/org/apache/camel/other.properties
+++ b/components/camel-platform-http-vertx/src/generated/resources/META-INF/services/org/apache/camel/other.properties
@@ -2,6 +2,6 @@
name=platform-http-vertx
groupId=org.apache.camel
artifactId=camel-platform-http-vertx
-version=3.4.4-SNAPSHOT
+version=3.4.5-SNAPSHOT
projectName=Camel :: Platform HTTP :: Vert.x
projectDescription=Implementation of the Platform HTTP Engine based on Vert.x Web
diff --git a/components/camel-platform-http-vertx/src/generated/resources/platform-http-vertx.json b/components/camel-platform-http-vertx/src/generated/resources/platform-http-vertx.json
index 45d67f7..f41dbe9 100644
--- a/components/camel-platform-http-vertx/src/generated/resources/platform-http-vertx.json
+++ b/components/camel-platform-http-vertx/src/generated/resources/platform-http-vertx.json
@@ -10,6 +10,6 @@
"supportLevel": "Stable",
"groupId": "org.apache.camel",
"artifactId": "camel-platform-http-vertx",
- "version": "3.4.4-SNAPSHOT"
+ "version": "3.4.5-SNAPSHOT"
}
}
diff --git a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java
index 125a4ed..fe37c13 100644
--- a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java
+++ b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpConsumer.java
@@ -64,16 +64,15 @@ public class VertxPlatformHttpConsumer extends DefaultConsumer {
private Route route;
public VertxPlatformHttpConsumer(
- PlatformHttpEndpoint endpoint,
- Processor processor,
- List<Handler<RoutingContext>> handlers,
- UploadAttacher uploadAttacher) {
+ PlatformHttpEndpoint endpoint,
+ Processor processor,
+ List<Handler<RoutingContext>> handlers,
+ UploadAttacher uploadAttacher) {
super(endpoint, processor);
this.handlers = handlers;
this.uploadAttacher = uploadAttacher;
- this.fileNameExtWhitelist
- = endpoint.getFileNameExtWhitelist() == null ? null : endpoint.getFileNameExtWhitelist().toLowerCase(Locale.US);
+ this.fileNameExtWhitelist = endpoint.getFileNameExtWhitelist() == null ? null : endpoint.getFileNameExtWhitelist().toLowerCase(Locale.US);
}
@Override
@@ -167,44 +166,44 @@ public class VertxPlatformHttpConsumer extends DefaultConsumer {
// .to("rest:get:?bridgeEndpoint=true");
//
vertx.executeBlocking(
- promise -> {
- try {
- createUoW(exchange);
- } catch (Exception e) {
- promise.fail(e);
- return;
- }
+ promise -> {
+ try {
+ createUoW(exchange);
+ } catch (Exception e) {
+ promise.fail(e);
+ return;
+ }
- getAsyncProcessor().process(exchange, c -> {
- if (!exchange.isFailed()) {
- promise.complete();
- } else {
- promise.fail(exchange.getException());
- }
- });
- },
- false,
- result -> {
- try {
- if (result.succeeded()) {
- try {
- writeResponse(ctx, exchange, getEndpoint().getHeaderFilterStrategy());
- } catch (Exception e) {
- getExceptionHandler().handleException(
- "Failed handling platform-http endpoint " + getEndpoint().getPath(),
- e);
- }
- } else {
+ getAsyncProcessor().process(exchange, c -> {
+ if (!exchange.isFailed()) {
+ promise.complete();
+ } else {
+ promise.fail(exchange.getException());
+ }
+ });
+ },
+ false,
+ result -> {
+ try {
+ if (result.succeeded()) {
+ try {
+ writeResponse(ctx, exchange, getEndpoint().getHeaderFilterStrategy());
+ } catch (Exception e) {
getExceptionHandler().handleException(
"Failed handling platform-http endpoint " + getEndpoint().getPath(),
- result.cause());
-
- ctx.fail(result.cause());
+ e);
}
- } finally {
- doneUoW(exchange);
+ } else {
+ getExceptionHandler().handleException(
+ "Failed handling platform-http endpoint " + getEndpoint().getPath(),
+ result.cause());
+
+ ctx.fail(result.cause());
}
- });
+ } finally {
+ doneUoW(exchange);
+ }
+ });
}
private Exchange toExchange(RoutingContext ctx) {
@@ -286,8 +285,8 @@ public class VertxPlatformHttpConsumer extends DefaultConsumer {
uploadAttacher.attachUpload(localFile, fileName, message);
} else {
LOGGER.debug(
- "Cannot add file as attachment: {} because the file is not accepted according to fileNameExtWhitelist: {}",
- fileName, fileNameExtWhitelist);
+ "Cannot add file as attachment: {} because the file is not accepted according to fileNameExtWhitelist: {}",
+ fileName, fileNameExtWhitelist);
}
}
}