add(new AjaxButton("upload", this) {
private static final long serialVersionUID = 839803820502260006L;
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
FileUpload upload = fileUploadField.getFileUpload();
try {
if (upload == null || upload.getInputStream() == null) {
uploadFeedback.error("File is empty");
return;
}
Application.getBean(BackupImportController.class)
.performImport(upload.getInputStream());
} catch (IOException e) {
log.error("IOException on panel backup upload ", e);
uploadFeedback.error(e);
} catch (Exception e) {
log.error("Exception on panel backup upload ", e);