Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- } else if(path.startsWith("file:")) {
- String filePath = path.substring(5, path.indexOf("!"));
- String internalPath = path.substring(path.indexOf("!") + 2);
- if (!new File(filePath).exists()) {
- throw new FileNotFoundException(path);
- }
- JarFile jf = new JarFile(filePath);
- ZipEntry zf = jf.getEntry(internalPath);
- if(zf == null) {
- throw new FileNotFoundException(path);
- }
- InputStream is = jf.getInputStream(zf);
- // FIXME: don't use RubyIO for this
- return new ChannelDescriptor(Channels.newChannel(is), RubyIO.getNewFileno(), flags, new FileDescriptor());
Add Comment
Please, Sign In to add comment