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