KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > services > DefaultFileSystemResolver


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 JavaDoc;
9
10 /**
11  * Resuerlve un file system por defecto
12  */

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 JavaDoc(getReportGeneratorConfiguration().getBasePath()));
26       }catch(Exception JavaDoc e){
27         throw new InfoException(com.calipso.reportgenerator.common.LanguageTraslator.traslate("211"),e);
28       }
29     }
30     return fileSystemManager;
31   }
32 }
33
Popular Tags