Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
archive:archive%3afile%253a%252f%252f%252ftmp%25%2fexample.war%2fWEB-INF%2flib%2fexample.jar/com/example/Main.class

URL Support

TBD

URLClassLoader Support

...

URL support is required to allow references to resources to be returned by a ClassLoader or ServletContext. To enable Path URIs to be converted to URLs, a !URLStreamHandlerFactory that supports the URI's scheme is required. When connecting, the !URLStreamHandler can convert the URL to a URI and then to a Path.

URLClassLoader Support

Classes may be loaded from an archive by converting the Path of its root directory to a URL and using a URLClassLoader:

No Format

  Path archivePath = ... ; // path to archive
  URI archiveURI = new URI("archive", archivePath.toUri().toString(), null, null, null);
  FileSystem archiveFS = FileSystems.newFileSystem(archiveURI, null);
  URL rootURL = archiveFS.getPath("/").toUri().toURL();
  ClassLoader loader = new URLClassLoader({rootURL});

ToDos

  • a way to read the zip’s central directory
  • a way to seek into a deflated zip entry without inflating the entire thing
  • is a ClassLoader from a list of Path helpful?
  • how to deal with the locking model on Windows platform
  • how to work with Paths that are directories - do we get this for free?
  • how to use the WatchService to detect changes e.g. web.xml or *.jsp touched?

Performance Measurements

TBD

Limitations in standard JDK APIs

...