this.uploadServer = uploadServer;
}
@Override
public FirstFromRequest getFirstFromRequest() {
UploadRequest request = requests.get();
Iterable<PotentialFile> potentials;
potentials = request.getPotentialFiles();
ToUploadedFile closure = new ToUploadedFile();
Iterable<UploadedFile> lazyFiles;
lazyFiles = Iterables.transform(potentials, closure);
List<UploadedFile> files;
files = ImmutableList.copyOf(lazyFiles);
boolean hasErrors = closure.hasErrors();
boolean hasFiles = !files.isEmpty();
UploadedForm form = request.getUploadedForm();
UploadCtx ctx = new UploadCtx(baseUrl, form, session, uploadServer);
if (hasFiles && !hasErrors) {
UploadedFile file = files.get(0);
return new FirstFromRequestValid(ctx, file);