Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== diff -u -ra5e98c783a05498313d5aa2c84c90241aa8843eb -r2b6abf25dfd33a6c8b0dba91267a444d7bf5d7e8 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision a5e98c783a05498313d5aa2c84c90241aa8843eb) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 2b6abf25dfd33a6c8b0dba91267a444d7bf5d7e8) @@ -20,6 +20,7 @@ import org.apache.log4j.Logger; import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.contentrepository.FileException; import org.lamsfoundation.lams.contentrepository.NodeKey; import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; import org.lamsfoundation.lams.tool.exception.ToolException; @@ -1165,7 +1166,7 @@ String offlineInstructions=""; String onlineInstructions=""; String endLearningMessage=""; - String creationDate=""; + Date creationDate=null; int passmark=0; boolean isQuestionsSequenced=false; @@ -1234,10 +1235,11 @@ String richTextEndLearningMessage=(String)request.getSession().getAttribute(RICHTEXT_END_LEARNING_MSG); logger.debug("richTextEndLearningMessage: " + richTextEndLearningMessage); - creationDate=(String)request.getSession().getAttribute(CREATION_DATE); + creationDate=(Date)request.getSession().getAttribute(CREATION_DATE); if (creationDate == null) - creationDate=new Date(System.currentTimeMillis()).toString(); + creationDate=new Date(System.currentTimeMillis()); + logger.debug("using creationDate: " + creationDate); /*obtain user object from the session*/ HttpSession ss = SessionManager.getSession(); @@ -2285,9 +2287,18 @@ logger.debug("mimeType:" + mimeType); logger.debug("fileProperty:" + fileProperty); - NodeKey nodeKey=mcService.uploadFile(stream, fileName, mimeType, fileProperty); - logger.debug("nodeKey:" + nodeKey); - logger.debug("nodeKey uuid:" + nodeKey.getUuid()); + NodeKey nodeKey=null; + try{ + nodeKey=mcService.uploadFile(stream, fileName, mimeType, fileProperty); + logger.debug("nodeKey:" + nodeKey); + logger.debug("nodeKey uuid:" + nodeKey.getUuid()); + } + catch(FileException e) + { + logger.debug("exception writing raw data:" + e); + /* return a null dto*/ + return null; + } McAttachmentDTO mcAttachmentDTO= new McAttachmentDTO(); mcAttachmentDTO.setUid(null);