Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java,v diff -u -r1.7 -r1.8 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java 5 Aug 2005 01:33:57 -0000 1.7 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java 8 Aug 2005 00:26:22 -0000 1.8 @@ -265,26 +265,14 @@ (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); float maxFileSize = UploadFileUtil.getMaxFileSize(); - - - /* if (toolContentId == null) - { - errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(NoticeboardConstants.ERROR_MANDATORY, "Tool COntent id")); - } - if (title==null || title.length()==0) - { - errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(NoticeboardConstants.ERROR_MANDATORY, "Title")); - } */ - - //check the file sizes so of the file uploads + if (this.offlineFile != null && offlineFile.getFileSize()!= 0) { float sizeOfOfflineUpload = offlineFile.getFileSize() / 1024 / 1024; //check the file size if (sizeOfOfflineUpload > maxFileSize) { - //show message saying the file is greater than the allowed limit - logger.error("the file uploaded exceeds the maximum file size"); + logger.error("file size " + sizeOfOfflineUpload + " Max File Size allowed: " + maxFileSize); errors.add("filesize", new ActionMessage("error.exceedMaxFileSize")); this.setMethod("Instructions"); } @@ -296,8 +284,8 @@ if (sizeOfOnlineUpload > maxFileSize) { -// show message saying the file is greater than the allowed limit - logger.error("the file uploaded exceeds the maximum file size"); + + logger.error("file size " + sizeOfOnlineUpload + " Max File Size allowed: " + maxFileSize); errors.add("filesize", new ActionMessage("error.exceedMaxFileSize")); this.setMethod("Instructions"); } @@ -307,6 +295,10 @@ } + private boolean isEmpty(String str) { + return str == null || str.trim().length() == 0 ; + } + }