@CommitAfter public void onSuccess() { File copied = new File(worksheetDirectory + file.getFileName()); file.write(copied); bib.setWorksheet(file.getFileName()); bib.setWorksheetExists(true); session.saveOrUpdate(bib); message = "Done. Uploaded : " + file.getFileName() + " in BIB: " + bib.getName(); }
public void onSuccessFromUploadFile() { File tempFile = new File(System.getProperty("user.dir"), file.getFileName()); file.write(tempFile); tempFile = new File(System.getProperty("user.dir"), file2.getFileName()); file2.write(tempFile); }
@SuppressWarnings({"unchecked"}) @Override protected void processSubmission(String controlName) { UploadedFile uploaded = decoder.getFileUpload(controlName); if (uploaded != null && (uploaded.getFileName() == null || uploaded.getFileName().length() == 0)) { uploaded = null; } try { fieldValidationSupport.validate(uploaded, resources, validate); } catch (ValidationException ex) { validationTracker.recordError(this, ex.getMessage()); } value = uploaded; }