Package com.jeecms.cms.entity.assist

Examples of com.jeecms.cms.entity.assist.CmsFile


  public CmsFile save(CmsFile bean) {
    return dao.save(bean);
  }

  public void saveFileByPath(String filepath, String name, Boolean valid) {
    CmsFile attFile=new CmsFile();
    attFile.setFilePath(filepath);
    attFile.setFileName(name);
    attFile.setFileIsvalid(valid);
    save(attFile);
  }
View Full Code Here


    attFile.setFileIsvalid(valid);
    save(attFile);
  }

  public void updateFileByPath(String path, Boolean valid, Content c) {
    CmsFile file;
    file=findByPath(path);
    if(file!=null){
      file.setContent(c);
      file.setFileIsvalid(valid);
      update(file);
    }
  }
View Full Code Here

      } else {
        files = parent.listFiles();
      }
      Arrays.sort(files, new FileComparator());
      List<FileWrap> list = new ArrayList<FileWrap>(files.length);
      CmsFile file;
      for (File f : files) {
        file=fileMng.findByPath(f.getName());
        if(file!=null){
          list.add(new FileWrap(f, realPathResolver.get(""),null,file.getFileIsvalid()));
        }else{
          list.add(new FileWrap(f, realPathResolver.get(""),null,false));
        }
      }
      return list;
View Full Code Here

    if (parent.exists()) {
      File[] files;
      files = parent.listFiles();
      Arrays.sort(files, new FileComparator());
      List<FileWrap> list = new ArrayList<FileWrap>(files.length);
      CmsFile file;
      for (File f : files) {
        file=fileMng.findByPath(f.getName());
        if(valid!=null){
          if(file!=null){
            if(file.getFileIsvalid().equals(valid)){
              list.add(new FileWrap(f, realPathResolver.get(""),null,valid));
            }
          }else{
            if(valid.equals(false)){
              list.add(new FileWrap(f, realPathResolver.get(""),null,false));
            }
          }
        }else{
          if(file!=null){
            list.add(new FileWrap(f, realPathResolver.get(""),null,file.getFileIsvalid()));
          }else{
            list.add(new FileWrap(f, realPathResolver.get(""),null,false));
          }
        }
      }
View Full Code Here

    }
  }


  public CmsFile findById(Integer id) {
    CmsFile entity = get(id);
    return entity;
  }
View Full Code Here

    getSession().save(bean);
    return bean;
  }

  public CmsFile deleteById(Integer id) {
    CmsFile entity = super.get(id);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }
View Full Code Here

    }
    return entity;
  }
 
  public CmsFile deleteByPath(String path) {
    CmsFile entity = findByPath(path);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }
View Full Code Here

  }
 
  public void updateFileByContent(Content bean,Boolean valid){
    Set<CmsFile>files;
    Iterator<CmsFile>it;
    CmsFile tempFile;
    //处理附件
    files=bean.getFiles();
    it=files.iterator();
    while(it.hasNext()){
      tempFile=it.next();
      tempFile.setFileIsvalid(valid);
      fileMng.update(tempFile);
    }
  }
View Full Code Here

TOP

Related Classes of com.jeecms.cms.entity.assist.CmsFile

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.