use of org.kuali.kfs.sys.web.struts.KualiBatchFileAdminForm in project cu-kfs by CU-CommunityApps.
the class CreateDoneKualiBatchFileAdminAction method createDone.
public ActionForward createDone(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
KualiBatchFileAdminForm fileAdminForm = (KualiBatchFileAdminForm) form;
String filePath = BatchFileUtils.resolvePathToAbsolutePath(fileAdminForm.getFilePath());
File file = new File(filePath).getAbsoluteFile();
BatchFile batchFile = new BatchFile();
batchFile.setFile(file);
if (!SpringContext.getBean(CreateDoneBatchFileAuthorizationService.class).canCreateDoneFile(batchFile, GlobalVariables.getUserSession().getPerson())) {
throw new RuntimeException("Error: not authorized to create a .done file");
}
String status = createDoneFile(filePath);
request.setAttribute("status", status);
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
Aggregations