Exemplo n.º 1
0
  @Override
  public String[] list(java.io.FilenameFilter filter) {

    LinkedList<String> names = new LinkedList<String>();
    for (ServerFile child : children) {
      if (filter == null || filter.accept(this, child.getName())) {
        names.add(child.getName());
      }
    }

    return names.toArray(new String[0]);
  };
Exemplo n.º 2
0
  @Override
  public File[] listFiles(FilenameFilter filter) {
    LinkedList<ServerFile> filtered = new LinkedList<ServerFile>();

    for (ServerFile child : children) {
      if (filter.accept(this, child.getName())) {
        filtered.add(child);
      }
    }
    return filtered.toArray(new File[0]);
  }