code: public static InputSupplier<InputStream> getEntry(final Location jarLocation,
                                                      final String entryName) throws IOException {
      Preconditions.checkArgument(jarLocation != null);
      Preconditions.checkArgument(entryName != null);
      final URI uri = jarLocation.toURI();
  
      // Small optimization if the location is local
      if ("file".equals(uri.getScheme())) {
        return new InputSupplier<InputStream>() {
  
          @Override
          public InputStream getInput() throws IOException {
            final JarFile jarFile = new JarFile(new File(uri));
            ZipEntry entry = jarFile.getEntry(entryName);
            if (entry == null) {
              throw new IOException("Entry not found for " + entryName);
            }
            return new FilterInputStream(jarFile.getInputStream(entry)) {
              @Override
              public void close() throws IOException {
                try {
                  super.close();
                } finally {
                  jarFile.close();
                }
              }
            };
          }
        };
      }
  
      // Otherwise, use JarInputStream
      return new InputSupplier<InputStream>() {
        @Override
        public InputStream getInput() throws IOException {
          JarInputStream is = new JarInputStream(jarLocation.getInputStream());
          JarEntry entry = is.getNextJarEntry();
          while (entry != null) {
            if (entryName.equals(entry.getName())) {
              return is;
            }
            entry = is.getNextJarEntry();
          }
          Closeables.closeQuietly(is);
          throw new IOException("Entry not found for " + entryName);
        }
      };
    }
docs: Returns an {@link com.google.common.io.InputSupplier} for a given entry. This avoids unjar the whole file to
  just get one entry. However, to get many entries, unjar would be more efficient. Also, the jar file
  is scanned every time the {@link com.google.common.io.InputSupplier#getInput()} is invoked.
  
  @param jarLocation Location of the jar file.
  @param entryName Name of the entry to fetch
  @return An {@link com.google.common.io.InputSupplier}.