private Either<AttachmentError, TemporaryWebAttachment> createTemporaryWebAttachmentWithoutValidation( @Nullable final ApplicationUser user, final InputStream stream, final long size, final String fileName, final String contentType, final String formToken) { try { final TemporaryAttachmentId attachmentId = attachmentManager.createTemporaryAttachment(stream, size); return addToMonitorCleanUpOnFailure( temporaryWebAttachmentsFactory.create(attachmentId, fileName, contentType, formToken, size), user); } catch (final Exception e) { log.debug("Exception occurred while attaching file.", e); return Either.left(new AttachmentError( "Exception occurred while attaching file: " + e.toString(), getI18n(user).getText("attachfile.error.io.error", fileName, e.getMessage()), fileName, Option.some(e), SERVER_ERROR )); } }