01: package com.calipso.reportgenerator.services;
02:
03: import org.apache.commons.vfs.impl.StandardFileSystemManager;
04: import org.apache.commons.vfs.FileSystemManager;
05: import com.calipso.reportgenerator.common.ReportGeneratorConfiguration;
06: import com.calipso.reportgenerator.common.InfoException;
07:
08: import java.io.File;
09:
10: /**
11: * Resuerlve un file system por defecto
12: */
13: public class DefaultFileSystemResolver extends FileSystemResolver {
14: private FileSystemManager fileSystemManager;
15:
16: public DefaultFileSystemResolver(
17: ReportGeneratorConfiguration reportGeneratorConfiguration) {
18: super (reportGeneratorConfiguration);
19: }
20:
21: public FileSystemManager getFileSystemManager()
22: throws InfoException {
23: if (fileSystemManager == null) {
24: fileSystemManager = new StandardFileSystemManager();
25: try {
26: ((StandardFileSystemManager) fileSystemManager).init();
27: ((StandardFileSystemManager) fileSystemManager)
28: .setBaseFile(new File(
29: getReportGeneratorConfiguration()
30: .getBasePath()));
31: } catch (Exception e) {
32: throw new InfoException(
33: com.calipso.reportgenerator.common.LanguageTraslator
34: .traslate("211"), e);
35: }
36: }
37: return fileSystemManager;
38: }
39: }
|