MiinCMP SAE版修正windows平台下无法获取文档问题

   原因:在本地测试时,出现文件路径错误,windows下路径为\ROOT\WEB-INF\,统一转换为/ROOT/WEB-INF/

 

 @Override
     public String readFile(File file,String encode){
       
         String pathweb=parentWebDir;// +"/"+  path;
       File f=new File(pathweb);
      
       String path=file.getPath().replace(f.getPath(), "");
      
       //转换为linux路径
      
       path=path.replace("\\", "/");
      
           MiinDocFileEntryService   docservice=MiinDocFileEntryService. getInstance();   
   
       MiinDocFile filedoc= docservice.getByFilepath(path);
     System.out.println("从Mysql服务器获取文档;"+path);
     if(filedoc==null){
          return "";
     }
        return filedoc.getContent();
     }

你可能感兴趣的:(MiinCMP SAE版修正windows平台下无法获取文档问题)