protected List<String> listResources(JarInputStream jar, String path) throws IOException {
    // Include the leading and trailing slash when matching names
    if (!path.startsWith("/")) {
      path = "/" + path;
    }
    if (!path.endsWith("/")) {
      path = path + "/";
    }

    // Iterate over the entries and collect those that begin with the requested path
    List<String> resources = new ArrayList<String>();
    for (JarEntry entry; (entry = jar.getNextJarEntry()) != null;) {
      if (!entry.isDirectory()) {
        // Add leading slash if it's missing
        String name = entry.getName();
        if (!name.startsWith("/")) {
          name = "/" + name;
        }

        // Check file name
        if (name.startsWith(path)) {
          log.debug("Found resource: " + name);
          // Trim leading slash
          resources.add(name.substring(1));
        }
      }
    }
    return resources;
  }
List the names of the entries in the given {@link JarInputStream} that begin with the
specified {@code path}. Entries will match with or without a leading slash.

@param jar The JAR input stream
@param path The leading path to match
@return The names of all the matching entries
@throws IOException If I/O errors occur
src/main/java/org/apache/ibatis/io/DefaultVFS.java