@Override
public HDFSFile[] getFiles(String directory) {
String result = executeCommand("hadoop fs -ls " + directory);
String[] items = result.split("\n");
List<HDFSFile> holder = new ArrayList<HDFSFile>();
for (int i = 1; i < items.length; i++) {
String item = items[i];
if (item.length() > MIN__FILE_LENGTH) {
try {
holder.add(new HDFSFile(item));
}
catch (Exception e) {
}
}
}
HDFSFile[] ret = new HDFSFile[holder.size()];
holder.toArray(ret);
return ret;
}
On Wed, Aug 25, 2010 at 12:36 AM, Denim Live <[email protected]> wrote:
> Hello, how can one determine the names of the files in a particular hadoop
> directory, programmatically?
>
>
>
>
--
Steven M. Lewis PhD
Institute for Systems Biology
Seattle WA