Package org.vosao.service.vo

Examples of org.vosao.service.vo.FileVO


 
  @Override
  public FileVO getFile(Long id, String encoding) {
    try {
      FileEntity file = getDao().getFileDao().getById(id);
      FileVO vo = new FileVO(file);
      FolderEntity folder = getDao().getFolderDao().getById(file
        .getFolderId());
      vo.setLink("/file" + getBusiness().getFolderBusiness()
          .getFolderPath(folder) + "/" + file.getFilename());
      String ext = FolderUtil.getFileExt(file.getFilename());
      vo.setTextFile(getBusiness().getConfigBusiness().isTextFileExt(ext));
      vo.setImageFile(getBusiness().getConfigBusiness()
          .isImageFileExt(ext));
      if (vo.isTextFile()) {
        vo.setContent(new String(getDao().getFileDao()
            .getFileContent(file), encoding));
      }
      return vo;
    }
    catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.vosao.service.vo.FileVO

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.