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

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

Introduction

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

Prototype

public final native String getType()
    ;

Source Link

Usage

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

License:Apache License

private boolean isValidMimeType(VHtml5File file) {
    if (acceptedMimeTypes != null && !acceptedMimeTypes.isEmpty()
            && !acceptedMimeTypes.contains(file.getType())) {
        String formattedErrorMsg = UploadClientUtil.getMimeTypeErrorMessage(mimeTypeErrorMsg, file.getName());
        VNotification.createNotification(1000, client.getUIConnector().getWidget()).show(formattedErrorMsg,
                VNotification.CENTERED, "warning");
        return false;
    }/*from  w w  w  .jav  a  2 s .  co m*/
    return true;
}

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

License:Apache License

private boolean isValidMimeType(VHtml5File file, StringBuilder errorMsg) {
    if (acceptedMimeTypes != null && !acceptedMimeTypes.isEmpty()
            && !acceptedMimeTypes.contains(file.getType())) {
        String formattedErrorMsg = UploadClientUtil.getMimeTypeErrorMessage(mimeTypeErrorMsg, file.getName());
        errorMsg.append(formattedErrorMsg).append("<br/>");
        return false;
    }//from  www . j  a v  a2 s. c o  m
    return true;
}