From 10aee6c787c0665df3726e1433d82f60d9f4dc2c Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 8 Apr 2020 14:33:09 +0200 Subject: [PATCH] http-file-upload: make order of parameters more logical --- .../smackx/httpfileupload/HttpFileUploadManager.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadManager.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadManager.java index ea367e9f4..2977f8601 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadManager.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/httpfileupload/HttpFileUploadManager.java @@ -264,7 +264,7 @@ public final class HttpFileUploadManager extends Manager { final long fileSize = file.length(); // Construct the FileInputStream first to make sure we can actually read the file. final FileInputStream fis = new FileInputStream(file); - upload(listener, fileSize, fis, slot); + upload(fis, fileSize, slot, listener); return slot.getGetUrl(); } @@ -308,7 +308,7 @@ public final class HttpFileUploadManager extends Manager { Objects.requireNonNull(fileName, "Filename Stream cannot be null"); Objects.requireNonNull(fileSize, "Filesize Stream cannot be null"); final Slot slot = requestSlot(fileName, fileSize, "application/octet-stream"); - upload(listener, fileSize, inputStream, slot); + upload(inputStream, fileSize, slot, listener); return slot.getGetUrl(); } @@ -431,8 +431,7 @@ public final class HttpFileUploadManager extends Manager { setTlsContext(sslContext); } - private void upload(UploadProgressListener listener, long fileSize, InputStream iStream, Slot slot) throws IOException { - + private void upload(InputStream iStream, long fileSize, Slot slot, UploadProgressListener listener) throws IOException { final URL putUrl = slot.getPutUrl(); final HttpURLConnection urlConnection = (HttpURLConnection) putUrl.openConnection();