Ejemplo n.º 1
0
  @Override
  public List<? extends ProxyNode> doGetChilds(int offset, int range, LongHolder numChildsLeft)
      throws ProxyException {
    FSPath[] files;
    try {
      files = file.listNodes();
    } catch (IOException e) {
      throw new ProxyException("Couldn't list contents:" + this, e);
    }

    if (files == null) {
      return null;
    }

    ArrayList<FSNodeProxyNode> nodes = new ArrayList<FSNodeProxyNode>(files.length);

    for (int i = 0; i < files.length; i++) {
      nodes.add(createNewNode(files[i]));
    }

    return subrange(nodes, offset, range);
  }