Examples of RAMFileSystem


Examples of juzu.impl.fs.spi.ram.RAMFileSystem

    fic.deleteOnExit();
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class);
    jar.addAsResource(new StringAsset("the_resource"), "resource.txt");
    jar.as(ZipExporter.class).exportTo(fic, true);
    JarFileSystem classpath = new JarFileSystem(new JarFile(fic));
    RAMFileSystem output = new RAMFileSystem();
    Compiler compiler = Compiler.builder().
        javaCompiler(compilerProvider).
        config(new CompilerConfig().force(true)).
        addClassPath(classpath).
        sourcePath(new RAMFileSystem()).
        output(output).build();
    GetResource processor = new GetResource(StandardLocation.CLASS_PATH, FileKey.newResourceName("", "resource.txt"));
    compiler.addAnnotationProcessor(processor);
    compiler.compile();
    processor.assertResource("the_resource");
View Full Code Here

Examples of juzu.impl.fs.spi.ram.RAMFileSystem

    processor.assertResource("the_resource");
  }

  // For now we don't support this until we figure the feature fully
  public void _testChange() throws Exception {
    RAMFileSystem ramFS = new RAMFileSystem();
    String[] root = ramFS.getRoot();
    String[] foo = ramFS.makePath(root, "foo");
    String[] a = ramFS.makePath(foo, "A.java");
    ramFS.updateResource(a, new Resource("package foo; public class A {}"));
    String[] b = ramFS.makePath(foo, "B.java");
    ramFS.updateResource(b, new Resource("package foo; public class B {}"));

    //
    RAMFileSystem output = new RAMFileSystem();
    Compiler compiler = Compiler.builder().sourcePath(ramFS).output(output).build();
    compiler.compile();
    assertEquals(2, output.size(ReadFileSystem.FILE));
    Timestamped<Resource> aClass = output.getResource(new String[]{"foo", "A"});
    assertNotNull(aClass);
    Timestamped<Resource> bClass = output.getResource(new String[]{"foo", "B"});
    assertNotNull(bClass);

    //
    while (true) {
      ramFS.updateResource(b, new Resource("package foo; public class B extends A {}"));
      if (bClass.getTime() < ramFS.getLastModified(b)) {
        break;
      }
      else {
        Thread.sleep(1);
      }
    }

    //
    compiler.compile();
    assertEquals(1, output.size(ReadFileSystem.FILE));
    bClass = output.getResource(new String[]{"foo", "B"});
    assertNotNull(bClass);
  }
View Full Code Here

Examples of org.apache.commons.vfs.provider.ram.RamFileSystem

  {
        if (!inited)
        {
            // Import the test tree
            FileObject fo = manager.resolveFile("ram:/");
      RamFileSystem fs = (RamFileSystem) fo.getFileSystem();
      fs.importTree(new File(AbstractVfsTestCase.getTestDirectory()));
      fo.close();
           
            inited=true;
        }
View Full Code Here

Examples of org.apache.commons.vfs2.provider.ram.RamFileSystem

    {
        if (!inited)
        {
            // Import the test tree
            FileObject fo = manager.resolveFile("ram:/");
            RamFileSystem fs = (RamFileSystem) fo.getFileSystem();
            fs.importTree(new File(AbstractVfsTestCase.getTestDirectory()));
            fo.close();

            inited=true;
        }
View Full Code Here

Examples of org.jnode.fs.ramfs.RAMFileSystem

            try {
                VirtualDevice dev =
                        VirtualDeviceFactory.createDevice(RAMFileSystemType.VIRTUAL_DEVICE_NAME);
                log.info(dev.getId() + " registered");

                final RAMFileSystem fs = type.create(dev, true);
                fSS.registerFileSystem(fs);

                final String mountPath = "jnode";
                fSS.mount(mountPath, fs, null);
                log.info("Mounted " + type.getName() + " on " + mountPath);

                FSDirectory root_dir = fs.getRootEntry().getDirectory();
                root_dir.addDirectory("home");
                root_dir.addDirectory("tmp");
                // adding files to /jnode/lib/ required by thecore classes
                FSDirectory libDir = (FSDirectory) root_dir.addDirectory("lib");
                InputStream is = RAMFSPlugin.class.getResourceAsStream("flavormap.properties");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.