File: FileList.java

package info (click to toggle)
gpsprune 26.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,824 kB
  • sloc: java: 52,154; sh: 25; makefile: 21; python: 15
file content (17 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package tim.prune.fileutils;

import java.io.File;

/** The method File.listFiles() can return null, so we want to avoid that */
public abstract class FileList
{
	/** Make sure the file list isn't null */
	public static File[] filesIn(File inDirectory)
	{
		File[] contents = (inDirectory == null ? null : inDirectory.listFiles());
		if (contents == null) {
			return new File[] {};
		}
		return contents;
	}
}