1 19 20 package org.netbeans.modules.db.test; 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/db/resources/mf-layer.xml")); 49 FileSystem dbapiLayerFs = new XMLFileSystem(RepositoryImpl.class.getClassLoader().getResource("org/netbeans/modules/dbapi/resources/layer.xml")); 50 return new MultiFileSystem(new FileSystem[] { writeFs, layerFs, dbapiLayerFs }); 51 } catch (SAXException e) { 52 return null; 53 } 54 } 55 } 56 | Popular Tags |