1 package com.calipso.reportgenerator.services; 2 3 import org.apache.commons.vfs.impl.StandardFileSystemManager; 4 import org.apache.commons.vfs.FileSystemManager; 5 import com.calipso.reportgenerator.common.ReportGeneratorConfiguration; 6 import com.calipso.reportgenerator.common.InfoException; 7 8 import java.io.File ; 9 10 13 public class DefaultFileSystemResolver extends FileSystemResolver{ 14 private FileSystemManager fileSystemManager; 15 16 public DefaultFileSystemResolver(ReportGeneratorConfiguration reportGeneratorConfiguration) { 17 super(reportGeneratorConfiguration); 18 } 19 20 public FileSystemManager getFileSystemManager() throws InfoException { 21 if (fileSystemManager == null){ 22 fileSystemManager = new StandardFileSystemManager(); 23 try { 24 ((StandardFileSystemManager)fileSystemManager).init(); 25 ((StandardFileSystemManager)fileSystemManager).setBaseFile(new File (getReportGeneratorConfiguration().getBasePath())); 26 }catch(Exception e){ 27 throw new InfoException(com.calipso.reportgenerator.common.LanguageTraslator.traslate("211"),e); 28 } 29 } 30 return fileSystemManager; 31 } 32 } 33 | Popular Tags |