Esempio n. 1
0
 @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();
 }
Esempio n. 2
0
  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);
  }
Esempio n. 3
0
  @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;
  }