From 731189bf3a6a06f5e433e0ce7c173b526dbb2da4 Mon Sep 17 00:00:00 2001 From: Julien Nioche Date: Fri, 18 Oct 2024 10:36:03 +0100 Subject: [PATCH] Fixed format Signed-off-by: Julien Nioche --- .../protocol/playwright/HttpProtocol.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/external/playwright/src/main/java/org/apache/stormcrawler/protocol/playwright/HttpProtocol.java b/external/playwright/src/main/java/org/apache/stormcrawler/protocol/playwright/HttpProtocol.java index 82d33e000..0dc698d80 100644 --- a/external/playwright/src/main/java/org/apache/stormcrawler/protocol/playwright/HttpProtocol.java +++ b/external/playwright/src/main/java/org/apache/stormcrawler/protocol/playwright/HttpProtocol.java @@ -37,7 +37,6 @@ import java.util.List; import java.util.Map; import java.util.Set; - import org.apache.commons.lang.StringUtils; import org.apache.storm.Config; import org.apache.storm.utils.MutableInt; @@ -106,7 +105,7 @@ public void configure(final Config conf) { final Map env = new HashMap<>(); // no need to download if we are connecting to a remote instance - if (StringUtils.isNotBlank(CDP_URL) || StringUtils.isNotBlank(REMOTE_WS)){ + if (StringUtils.isNotBlank(CDP_URL) || StringUtils.isNotBlank(REMOTE_WS)) { skipDownloads = true; } @@ -118,13 +117,12 @@ public void configure(final Config conf) { creationOptions.setEnv(env); BrowserType btype = Playwright.create(creationOptions).chromium(); - if (StringUtils.isNotBlank(CDP_URL) && StringUtils.isNotBlank(REMOTE_WS)){ - throw new RuntimeException("Can't specify both cdp.url and remote.ws in the configuration"); - } - else if (StringUtils.isNotBlank(CDP_URL)) { + if (StringUtils.isNotBlank(CDP_URL) && StringUtils.isNotBlank(REMOTE_WS)) { + throw new RuntimeException( + "Can't specify both cdp.url and remote.ws in the configuration"); + } else if (StringUtils.isNotBlank(CDP_URL)) { browser = btype.connectOverCDP(CDP_URL); - } - else if (StringUtils.isNotBlank(REMOTE_WS)) { + } else if (StringUtils.isNotBlank(REMOTE_WS)) { browser = btype.connect(REMOTE_WS); } else { browser = btype.launch();