@Override default O apply(I t) { // defer to the deprecated signature return eval(t); }
@Override default O apply(I t) { // defer to the deprecated signature return eval(t); }
private WizardPageController nextPageControllerUpload(Map<String, List<String>> formParameters) { final List<String> excelSpreadsheetUploads = formParameters.get("excel_spreadsheet_upload"); if (excelSpreadsheetUploads == null || excelSpreadsheetUploads.isEmpty()) { throw new DCUserInputException("Please upload a file before clicking 'Next'!"); } final String fileJsonString = excelSpreadsheetUploads.get(0); if (StringUtils.isNullOrEmpty(fileJsonString)) { throw new DCUserInputException("Please upload a file before clicking 'Next'!"); } final Map<String, String> fileJson = parseJson(fileJsonString); final String sessionKey = fileJson.get("session_key"); final String filename = fileJson.get("file_name"); final File tempFile = (File) _wizardContext.getHttpSession().eval(sessionKey); return nextPageControllerUpload(filename, tempFile); }
private WizardPageController nextPageControllerUpload(Map<String, List<String>> formParameters) { final List<String> csvFileUploads = formParameters.get("csv_file_upload"); if (csvFileUploads == null || csvFileUploads.isEmpty()) { throw new DCUserInputException("Please upload a file before clicking 'Next'!"); } final String fileJsonString = csvFileUploads.get(0); if (StringUtils.isNullOrEmpty(fileJsonString)) { throw new DCUserInputException("Please upload a file before clicking 'Next'!"); } final Map<String, String> fileJson = parseJson(fileJsonString); final String sessionKey = fileJson.get("session_key"); final String filename = fileJson.get("file_name"); final File tempFile = (File) _wizardContext.getHttpSession().eval(sessionKey); return nextPageControllerUpload(filename, tempFile); }
@Override public <E> E read(Func<InputStream, E> readCallback) throws ResourceException { try { InputStream in = _fileObject.getContent().getInputStream(); try { E result = readCallback.eval(in); return result; } finally { FileHelper.safeClose(in); } } catch (Exception e) { throw new ResourceException(this, e); } } }