Well, here's the important line from the documentation:
Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname. If this abstract pathname does not denote a directory, then this method returns null.
In your example search is a File object representing a file, not a directory (you can also check this by looking at the value returned by
search.isDirectory()). So it returns
null.
If you use
search.getParent(), that will return a File object representing the directory the file is in. Then call
list() on that, and see what happens.