1 19 20 package org.netbeans.modules.tomcat5.util; 21 22 import org.openide.filesystems.FileSystem; 23 import org.openide.filesystems.FileUtil; 24 import org.openide.filesystems.MultiFileSystem; 25 import org.openide.filesystems.Repository; 26 import org.openide.filesystems.XMLFileSystem; 27 import org.xml.sax.SAXException ; 28 29 36 public class RepositoryImpl extends Repository { 37 38 private XMLFileSystem system; 39 40 public RepositoryImpl() { 41 super(createDefFs()); 42 } 43 44 private static FileSystem createDefFs() { 45 try 46 { 47 FileSystem writeFs = FileUtil.createMemoryFileSystem(); 48 FileSystem layerFs = new XMLFileSystem(RepositoryImpl.class.getClassLoader().getResource("org/netbeans/modules/tomcat5/resources/layer.xml")); 49 FileSystem j2eeserverFs = new XMLFileSystem(RepositoryImpl.class.getClassLoader().getResource("org/netbeans/modules/tomcat5/util/fake-j2eeserver-layer.xml")); 50 FileSystem dbFs = new XMLFileSystem(RepositoryImpl.class.getClassLoader().getResource("org/netbeans/modules/db/resources/mf-layer.xml")); 51 return new MultiFileSystem(new FileSystem[] { writeFs, layerFs, j2eeserverFs, dbFs}); 52 } catch (SAXException e) { 53 return null; 54 } 55 } 56 } 57 | Popular Tags |