diff --git a/src/main/java/stirling/software/SPDF/config/security/UserService.java b/src/main/java/stirling/software/SPDF/config/security/UserService.java index 7b8c5ff0..b1b51596 100644 --- a/src/main/java/stirling/software/SPDF/config/security/UserService.java +++ b/src/main/java/stirling/software/SPDF/config/security/UserService.java @@ -22,7 +22,6 @@ import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.oauth2.core.user.OAuth2User; import org.springframework.stereotype.Service; -import lombok.extern.slf4j.Slf4j; import stirling.software.SPDF.config.DatabaseBackupInterface; import stirling.software.SPDF.config.security.session.SessionPersistentRegistry; import stirling.software.SPDF.controller.api.pipeline.UserServiceInterface; diff --git a/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java b/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java index aa5f3aea..1efd2446 100644 --- a/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java +++ b/src/main/java/stirling/software/SPDF/utils/GeneralUtils.java @@ -4,7 +4,9 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.net.HttpURLConnection; import java.net.MalformedURLException; +import java.net.URL; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; @@ -13,8 +15,6 @@ import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.List; -import java.net.URL; -import java.net.HttpURLConnection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,8 +73,7 @@ public class GeneralUtils { } catch (MalformedURLException e) { return false; } - - } + } public static boolean isURLReachable(String urlStr) { try { @@ -112,16 +111,19 @@ public class GeneralUtils { sizeStr = sizeStr.replace(",", ".").replace(" ", ""); try { if (sizeStr.endsWith("KB")) { - return (long) (Double.parseDouble(sizeStr.substring(0, sizeStr.length() - 2)) * 1024); + return (long) + (Double.parseDouble(sizeStr.substring(0, sizeStr.length() - 2)) * 1024); } else if (sizeStr.endsWith("MB")) { - return (long) (Double.parseDouble(sizeStr.substring(0, sizeStr.length() - 2)) - * 1024 - * 1024); + return (long) + (Double.parseDouble(sizeStr.substring(0, sizeStr.length() - 2)) + * 1024 + * 1024); } else if (sizeStr.endsWith("GB")) { - return (long) (Double.parseDouble(sizeStr.substring(0, sizeStr.length() - 2)) - * 1024 - * 1024 - * 1024); + return (long) + (Double.parseDouble(sizeStr.substring(0, sizeStr.length() - 2)) + * 1024 + * 1024 + * 1024); } else if (sizeStr.endsWith("B")) { return Long.parseLong(sizeStr.substring(0, sizeStr.length() - 1)); } else { @@ -191,8 +193,7 @@ public class GeneralUtils { // Check if the result is null or not within bounds if (result == null || result <= 0 || result.intValue() > maxValue) { - if (n != 0) - break; + if (n != 0) break; } else { results.add(result.intValue()); } diff --git a/src/main/resources/static/js/downloader.js b/src/main/resources/static/js/downloader.js index c955bb1b..87d2670a 100644 --- a/src/main/resources/static/js/downloader.js +++ b/src/main/resources/static/js/downloader.js @@ -37,7 +37,7 @@ $(document).ready(function () { try { if (remoteCall === true) { - if (override === "multi" || (!multiple && files.length > 1 && override !== "single")) { + if (override === "multi" || (!multipleInputsForSingleRequest && files.length > 1 && override !== "single")) { await submitMultiPdfForm(url, files); } else { await handleSingleDownload(url, formData); diff --git a/src/main/resources/templates/auto-split-pdf.html b/src/main/resources/templates/auto-split-pdf.html index 06915a47..2ef7e23d 100644 --- a/src/main/resources/templates/auto-split-pdf.html +++ b/src/main/resources/templates/auto-split-pdf.html @@ -24,7 +24,7 @@