Package net.naijatek.myalumni.modules.common.presentation.form

Examples of net.naijatek.myalumni.modules.common.presentation.form.SystemForm


    if (!adminSecurityCheck(request)) {
      return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
    }
    ActionMessages msgs = new ActionMessages();
    SystemForm sysForm = (SystemForm)form;
    String file = getSysProp().getValue("BACKUP.FILEPATH") + sysForm.getLogFileName();
    File sqlFile = new File(file);
   
    if (sqlFile.exists() && sqlFile.isFile()){
        sqlFile.delete();
        msgs.add(BaseConstants.INFO_KEY, new ActionMessage("message.successfullydeleted", sysForm.getLogFileName()));
        saveMessages(request, msgs);
    }
    else{
      msgs.add(BaseConstants.INFO_KEY, new ActionMessage("message.unabletodelete", file));
      saveMessages(request, msgs);
View Full Code Here


    if (!adminSecurityCheck(request)) {
      return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
    }
   
    SystemForm sysForm = (SystemForm)form;
   
    if (sysForm.getLogType() == null || sysForm.getLogType().length() == 0) {
      sysForm.setLogType("ALL");
    }

    File file = new File(getSysProp().getValue("BACKUP.FILEPATH") + sysForm.getLogFileName());
    sysForm.setLineCount("5000") ;
    String[] contentLog = FileUtil.getLastLines(file, Integer.parseInt(sysForm.getLineCount()), sysForm.getLogType());
   
//    List<String> al = new ArrayList<String>(contentLog.length);
//    for (int j=0;j<contentLog.length;j++) {
//        al.add(contentLog[j]);
//    }
View Full Code Here

    if (!adminSecurityCheck(request)) {
      return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
    }
    ActionMessages msgs = new ActionMessages();
    SystemForm sysForm = (SystemForm)form;
    String file = getSysProp().getValue("LOGFILE.FILEPATH") + sysForm.getLogFileName();
    File logFile = new File(file);
   
    if (logFile.exists() && logFile.isFile()){
        logFile.delete();
        msgs.add(BaseConstants.INFO_KEY, new ActionMessage("message.successfullydeleted", sysForm.getLogFileName()));
        saveMessages(request, msgs);
    }
    else{
      msgs.add(BaseConstants.INFO_KEY, new ActionMessage("message.unabletodelete", file));
      saveMessages(request, msgs);
View Full Code Here

    if (!adminSecurityCheck(request)) {
      return mapping.findForward(BaseConstants.FWD_ADMIN_LOGIN);
    }
   
    SystemForm sysForm = (SystemForm)form;
    int lineCount = 0;
    try {
      lineCount = Integer.parseInt(sysForm.getLineCount()); // 25, 50 100 200 400 800)
    } catch (Exception e) {
      if (lineCount == 0) {
        lineCount = 50;
      }
    }

    if (lineCount > 5000) {
      lineCount = 5000;
    }
   
    if (sysForm.getLogType() == null || sysForm.getLogType().length() == 0) {
      sysForm.setLogType("ALL");
    }

    File logFile = new File(getSysProp().getValue("LOGFILE.FILEPATH") + sysForm.getLogFileName());
    sysForm.setLineCount(String.valueOf(lineCount)) ;
    String[] contentLog = FileUtil.getLastLines(logFile, lineCount, sysForm.getLogType());
   
    String humanSize = FileUtil.getHumanSize(logFile.length());
    sysForm.setLogFileSize(String.valueOf(logFile.length()));
    sysForm.setLogFileHumanSize(humanSize);
   
    setSessionObject(request, BaseConstants.LOG_CONTENT, contentLog);
    return mapping.findForward(BaseConstants.FWD_SUCCESS);
  }
View Full Code Here

TOP

Related Classes of net.naijatek.myalumni.modules.common.presentation.form.SystemForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.