1 19 20 package org.netbeans.modules.j2ee.ejbcore.test; 21 22 import org.openide.filesystems.FileSystem; 23 import org.openide.filesystems.MultiFileSystem; 24 import org.openide.filesystems.Repository; 25 import org.openide.filesystems.XMLFileSystem; 26 import org.xml.sax.SAXException ; 27 28 32 public class RepositoryImpl extends Repository { 33 34 public RepositoryImpl() { 35 super(new MultiFileSystemImpl()); 36 } 37 38 public static final class MultiFileSystemImpl extends MultiFileSystem { 39 40 public MultiFileSystemImpl() { 41 super(createFileSystems()); 42 } 43 44 public void reset() { 45 setDelegates(createFileSystems()); 46 } 47 48 private static FileSystem[] createFileSystems() { 49 try { 50 FileSystem j2eeserverFs = new XMLFileSystem(RepositoryImpl.class.getClassLoader().getResource("org/netbeans/modules/j2ee/deployment/impl/layer.xml")); 51 FileSystem ejbCoreFs = new XMLFileSystem(RepositoryImpl.class.getClassLoader().getResource("layer.xml")); 52 return new FileSystem[] { j2eeserverFs, ejbCoreFs }; 53 } catch (SAXException e) { 54 AssertionError assertionError = new AssertionError (e.getMessage()); 55 assertionError.initCause(e); 56 throw assertionError; 57 } 58 } 59 } 60 } 61 | Popular Tags |