Example usage for com.vaadin.client.ui.dd VHtml5File getSize

List of usage examples for com.vaadin.client.ui.dd VHtml5File getSize

Introduction

In this page you can find the example usage for com.vaadin.client.ui.dd VHtml5File getSize.

Prototype

public final native double getSize()
    ;

Source Link

Usage

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.client.VCustomUpload.java

License:Apache License

private boolean isValidFileSize(VHtml5File file) {
    if (file.getSize() > maxFileSize || file.getSize() <= 0) {
        String formattedErrorMsg = UploadClientUtil.getSizeErrorMessage(sizeErrorMsg, maxFileSize,
                file.getSize(), file.getName());
        VNotification.createNotification(1000, client.getUIConnector().getWidget()).show(formattedErrorMsg,
                VNotification.CENTERED, "warning");
        return false;
    }/*www .j  a v a 2 s  . co m*/
    return true;
}

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.client.VMultiUpload.java

License:Apache License

private boolean isValidFileSize(VHtml5File file, StringBuilder errorMsg) {
    if (file.getSize() > maxFileSize || file.getSize() <= 0) {
        String formattedErrorMsg = UploadClientUtil.getSizeErrorMessage(sizeErrorMsg, maxFileSize,
                file.getSize(), file.getName());

        errorMsg.append(formattedErrorMsg).append("<br/>");
        return false;
    }/*  w w w. j a  v  a  2 s.c o  m*/
    return true;
}