Gets the list of entries in the specified directory.

@param directory the directory to get the entries of.
@return the list of entries (never <code>null</code>).
@since 1.0
724
private synchronized List<Entry> getEntriesList( DirectoryEntry directory )
    {
        List<Entry> entries = contents.get( directory );
        if ( entries == null )
        {
            entries = new ArrayList<Entry>();
            contents.put( directory, entries );
        }
        return entries;
    }
906183
public static List<File> getDirectoriesByName(String root) {
        if (root == null || root.length() == 0)
            return Collections.emptyList();

        return getDirectories(new File(root));
    }
558546
@Nullable
  public DirectoryEntry get(Name name) {
    int index = bucketIndex(name, table.length);

    DirectoryEntry entry = table[index];
    while (entry != null) {
      if (name.equals(entry.name())) {
        return entry;
      }

      entry = entry.next;
    }
    return null;
  }
565717
public static File[] listExtensions(String extensionDir) {
    File[] extensions = new File(extensionDir)
        .listFiles(file -> file.getPath().toLowerCase().endsWith(Constants.EXTENSION_JAR));
    if (extensions == null) {
      // Directory does not exist
      return EMPTY_EXTENSIONS_LIST;
    }
    return extensions;
  }
112456
public List<String> list(String folder) throws IOException {
      List<String> res = new ArrayList<String>();
      if (path != null) {
        File f = new File(Utilities.path(path, folder));
        if (f.exists() && f.isDirectory())
          for (String s : f.list())
            res.add(s);
      } else {
        for (String s : content.keySet()) {
          if (s.startsWith(folder+"/") && !s.substring(folder.length()+2).contains("/"))
            res.add(s.substring(folder.length()+1));
        }
      }
      return res;
    }
126476
protected function listDirectoryContents($directory = '.')
    {
        if ($directory && strpos($directory, '.') !== 0) {
            ftp_chdir($this->getConnection(), $directory);
        }

        $listing = @ftp_rawlist($this->getConnection(), '.') ?: [];

        $this->setConnectionRoot();

        return  $this->normalizeDirectoryListing($listing);
    }
42743
def get_entries(path):
    """"""
    dirs, files = [], []
    for entry in os.listdir(path):
        # Categorize entry as directory or file.
        if os.path.isdir(os.path.join(path, entry)):
            dirs.append(entry)
        else:
            files.append(entry)
    dirs.sort()
    files.sort()
    return dirs, files
1147909
public List<DSLMappingEntry> getEntries(final DSLMappingEntry.Section section) {
        final List<DSLMappingEntry> list = new LinkedList<DSLMappingEntry>();
        for ( final Iterator<DSLMappingEntry> it = this.entries.iterator(); it.hasNext(); ) {
            final DSLMappingEntry entry = it.next();
            if ( entry.getSection().equals( section ) ) {
                list.add( entry );
            }
        }
        return list;
    }
589067
public static File[] listFilesSortedByModDate(File dir) {
        File[] backupDirFiles = dir.listFiles();
        Arrays.sort(backupDirFiles, new FileComparator());
        return backupDirFiles;
    }
60001
private static List<String> getResourcesFromDirectory(final File directory, final Pattern searchPattern) {
        final List<String> resources = new ArrayList<>();

        // Filter only properties files
        final File[] fileList = directory.listFiles();

        if (fileList != null && fileList.length > 0) {
            // Iterate over each relevant file
            for (final File file : fileList) {
                // If the file is a directory process a recursive call to explorer the tree
                if (file.isDirectory()) {
                    resources.addAll(getResourcesFromDirectory(file, searchPattern));
                } else {
                    try {
                        checkResource(resources, searchPattern, file.getCanonicalPath());
                    } catch (final IOException e) {
                        LOGGER.log(BAD_CANONICAL_PATH, e);
                    }
                }
            }
        }
        return resources;
    }
815122
private static String recursiveSearch(java.io.File dir, String fileName) {
        for (String name : dir.list()) {
            java.io.File file = new java.io.File(dir.getAbsolutePath() + "/" + name);
            if (name.compareTo(fileName) == 0) return file.getAbsolutePath();
            if (file.isDirectory()) {
                String filePath = recursiveSearch(file, fileName);
                if (filePath != null) return filePath;
            }
        }

        return null;
    }
361142
protected static File findRawDir(File dir) {
		for (int i = 0; dir != null && i < 20; i++) {
			File rawDir = findResRawDir(dir);
			if (rawDir != null) {
				return rawDir;
			}
			dir = dir.getParentFile();
		}
		return null;
	}
947700
public List<Entry> getTopEntries() {
        if (root != null && root.getGroups() != null && root.getGroups().size() == 1) {
            return root.getGroups().get(0).getEntries();
        }
        return new ArrayList<Entry>();
    }
434655
public File[] getAllFilesBelow(File dir) {
        Set allFiles = new HashSet();
        if (dir.isDirectory()) {
            primGetAllFilesBelow(dir, allFiles);
        }
        return (File[]) allFiles.toArray(new File[allFiles.size()]);
    }
1371424
public File[] listFiles(String directoryPath) {
        File[] result = null;
        File directory = null;
        directory = new File(directoryPath);
        if (directory.isDirectory()) {
            result = directory.listFiles();
        }
        return result;
    }
965057
public static long getDirectorySize(File directory) {
        if (!directory.exists()) {
            throw new IllegalArgumentException(directory + " does not exist");
        }

        if (!directory.isDirectory()) {
            throw new IllegalArgumentException(directory + " is not a directory");
        }
        long size = 0;
        File[] files = directory.listFiles();
        if (files == null) {
            // null if security restricted
            return 0L;
        }
        for (int i = 0; i < files.length; i++) {
            File file = files[i];

            if (file.isDirectory()) {
                size += getDirectorySize(file);
            } else {
                size += file.length();
            }
        }
        return size;
    }
875509
private static File[] loadXmlFiles(final File directory) {
		return directory.listFiles(new FileFilter() {

			@Override
			public boolean accept(File file) {
				return file.getName().endsWith(".xml");
			}

		});
	}