diff --git a/modules/core/src/com/haulmont/cuba/core/sys/FileLoaderImpl.java b/modules/core/src/com/haulmont/cuba/core/sys/FileLoaderImpl.java index 15c05eb6fb..e832ef1f64 100644 --- a/modules/core/src/com/haulmont/cuba/core/sys/FileLoaderImpl.java +++ b/modules/core/src/com/haulmont/cuba/core/sys/FileLoaderImpl.java @@ -25,7 +25,6 @@ import org.springframework.stereotype.Component; import javax.annotation.Nullable; import javax.inject.Inject; import java.io.InputStream; -import java.util.function.Consumer; import java.util.function.Supplier; @Component(FileLoader.NAME) @@ -40,7 +39,7 @@ public class FileLoaderImpl implements FileLoader { @Override public void saveStream(FileDescriptor fd, Supplier inputStreamSupplier, - @Nullable Consumer streamingListener) + @Nullable StreamingProgressListener streamingListener) throws FileStorageException, InterruptedException { fileStorageAPI.saveStream(fd, inputStreamSupplier.get()); } diff --git a/modules/gui/src/com/haulmont/cuba/gui/upload/FileUploading.java b/modules/gui/src/com/haulmont/cuba/gui/upload/FileUploading.java index fde9980120..63c706b11d 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/upload/FileUploading.java +++ b/modules/gui/src/com/haulmont/cuba/gui/upload/FileUploading.java @@ -261,9 +261,9 @@ public class FileUploading implements FileUploadingAPI, FileUploadingMBean { }; if (listener != null) { - fileLoader.saveStream(fileDescr, inputStreamSupplier, e -> { + fileLoader.saveStream(fileDescr, inputStreamSupplier, transferredBytes -> { try { - listener.progressChanged(fileId, e.getTransferredBytes(), fileSize); + listener.progressChanged(fileId, transferredBytes, fileSize); } catch (InterruptedException ie) { // if thread is already interrupted we will restore interrupted flag Thread.currentThread().interrupt();