Package juzu.impl.fs.spi.jar

Examples of juzu.impl.fs.spi.jar.JarFileSystem


    if (protocol.equals("jar")) {
      String path = url.getPath();
      int pos = path.lastIndexOf("!/");
      URL nested = new URL(path.substring(0, pos));
      if (nested.getProtocol().equals("file")) {
        return new JarFileSystem(url);
      } else {
        throw new IOException("Cannot handle nested jar URL " + url);
      }
    } else if (protocol.equals("file")) {
      File f;
      try {
        f = new File(url.toURI());
      }
      catch (URISyntaxException e) {
        throw new IOException(e);
      }
      if (f.isDirectory()) {
        return new DiskFileSystem(f);
      } else {
        return new JarFileSystem(url);
      }
    } else {
      throw new IOException("Unsupported URL: " + url);
    }
  }
View Full Code Here


    File fic = File.createTempFile("test", ".jar");
    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).
View Full Code Here

TOP

Related Classes of juzu.impl.fs.spi.jar.JarFileSystem

Copyright © 2018 www.massapicom. 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.