Skip to content

Commit

Permalink
Remove maxFileUploadSize property from the FilePicker API
Browse files Browse the repository at this point in the history
  • Loading branch information
besidev committed Oct 17, 2023
1 parent 9019d7e commit 9f23555
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package one.jpro.platform.file.picker;

import com.jpro.webapi.WebAPI;
import javafx.beans.property.LongProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyDoubleProperty;
import javafx.beans.property.StringProperty;
Expand Down Expand Up @@ -29,8 +28,6 @@
*/
public interface FilePicker<F extends FileSource<?>> {

int INDEFINITE = -1;

/**
* Creates a file picker. If the application is running in a
* browser via JPro server, then a web version of the file
Expand Down Expand Up @@ -196,23 +193,4 @@ static FilePicker<? extends FileSource<?>> create(Node node) {
* no file has been selected.
*/
ObjectProperty<Consumer<List<F>>> onFilesSelectedProperty();

/**
* Returns the maximum file upload size allowed.
*
* @return the maximum file upload size in bytes
*/
long getMaxFileUploadSize();

/**
* Sets the maximum file upload size allowed.
*
* @param value the maximum file upload size in bytes to be set
*/
void setMaxFileUploadSize(long value);

/**
* Defines the maximum file upload size allowed.
*/
LongProperty maxFileUploadSizeProperty();
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package one.jpro.platform.file.picker.impl;

import javafx.beans.binding.Bindings;
import javafx.beans.property.*;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyDoubleProperty;
import javafx.beans.property.ReadOnlyDoubleWrapper;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Node;
Expand Down Expand Up @@ -94,27 +96,6 @@ public final void setSelectionMode(final SelectionMode value) {
selectionModeProperty().setValue(value);
}

// max file upload size property
private LongProperty maxFileUploadSize;

@Override
public long getMaxFileUploadSize() {
return maxFileUploadSize == null ? INDEFINITE : maxFileUploadSize.get();
}

@Override
public void setMaxFileUploadSize(long value) {
maxFileUploadSizeProperty().setValue(value);
}

@Override
public LongProperty maxFileUploadSizeProperty() {
if (maxFileUploadSize == null) {
maxFileUploadSize = new SimpleLongProperty(this, "maxFileUploadSize", INDEFINITE);
}
return maxFileUploadSize;
}

void updateTotalProgress(final List<? extends FileSource<?>> fileSources) {
uploadProgressPropertyImpl().unbind();
uploadProgressPropertyImpl().bind(Bindings.createDoubleBinding(() ->
Expand Down

0 comments on commit 9f23555

Please sign in to comment.