1 19 package org.openide.filesystems.xmlfs; 20 21 import java.io.*; 22 import java.net.URLClassLoader ; 23 import java.net.URL ; 24 25 import org.openide.*; 26 import org.openide.filesystems.*; 27 import org.openide.filesystems.localfs.LocalFSTest; 28 import org.openide.filesystems.data.SerialData; 29 30 33 public class XMLinJarFSTest extends XMLFSTest { 34 35 URLClassLoader cloader; 36 37 38 public XMLinJarFSTest(String name) { 39 super(name); 40 } 41 42 43 protected FileObject[] setUpFileObjects(int foCount) throws Exception { 44 tmp = createTempFolder(); 45 destFolder = LocalFSTest.createFiles(foCount, 0, tmp); 46 File xmlbase = generateXMLFile(destFolder, new ResourceComposer(LocalFSTest.RES_NAME, LocalFSTest.RES_EXT, foCount, 0)); 47 File jar = Utilities.createJar(tmp, "jarxmlfs.jar"); 48 cloader = new URLClassLoader (new URL [] { jar.toURL() }); 49 URL res = cloader.findResource(PACKAGE + xmlbase.getName()); 50 xmlfs = new XMLFileSystem(); 51 xmlfs.setXmlUrl(res, false); 52 53 FileObject pkg = xmlfs.findResource(PACKAGE); 54 return pkg.getChildren(); 55 } 56 57 66 } 67 | Popular Tags |