Exemplo n.º 1
0
  protected void getResources(List<Resource> list, boolean recursive) throws IOException {
    Set paths = context.getResourcePaths(path);

    if (paths != null) {
      for (Object obj : paths) {
        String path = (String) obj;
        if (!path.endsWith("/")) {
          int n = path.lastIndexOf('/', path.length() - 1);
          String name = path.substring(n + 1);
          list.add(lookupResource(name));
        } else if (recursive) {
          int n = path.lastIndexOf('/', path.length() - 2);
          String name = path.substring(n + 1, path.length() - 1);
          AbstractRepository repo = lookupRepository(name);
          repo.getResources(list, true);
        }
      }
    }
  }