Exemplo n.º 1
0
 /**
  * 修改 FTPConfig 的监视信息之后返回FTPConfig列表页面
  *
  * @return
  */
 private void changeFtpManage() {
   boolean result = false;
   FTPConfig ftpConfig = new FTPConfig();
   FTPConfigDao ftpConfigDao = null;
   try {
     String id = getParaValue("id");
     int monflag = getParaIntValue("value");
     ftpConfigDao = new FTPConfigDao();
     ftpConfig = (FTPConfig) ftpConfigDao.findByID(id);
     ftpConfig.setMonflag(monflag);
     result = ftpConfigDao.update(ftpConfig);
     Ftp ftp = (Ftp) PollingEngine.getInstance().getFtpByID(Integer.parseInt(id));
     ftp.setMonflag(monflag);
   } catch (Exception e) {
     e.printStackTrace();
     result = false;
   } finally {
     ftpConfigDao.close();
   }
 }
Exemplo n.º 2
0
  /**
   * 获取 FTP 列表
   *
   * @return
   */
  public List getFtpList() {
    // FTP

    List ftplist = null;

    FTPConfigDao ftpConfigDao = new FTPConfigDao();
    try {
      ftplist = ftpConfigDao.findByCondition(getFtpSql());
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      ftpConfigDao.close();
    }

    if (ftplist == null) {
      ftplist = new ArrayList();
    }

    return ftplist;
  }