(String location, FileSystem fs, PathFilter filter)
| 397 | } |
| 398 | |
| 399 | private static Path getFirstFile(String location, FileSystem fs, PathFilter filter) throws IOException { |
| 400 | String[] locations = getPathStrings(location); |
| 401 | Path[] paths = new Path[locations.length]; |
| 402 | for (int i = 0; i < paths.length; ++i) { |
| 403 | paths[i] = new Path(locations[i]); |
| 404 | } |
| 405 | List<FileStatus> statusList = new ArrayList<FileStatus>(); |
| 406 | for (int i = 0; i < paths.length; ++i) { |
| 407 | FileStatus[] files = fs.globStatus(paths[i]); |
| 408 | if (files != null) { |
| 409 | for (FileStatus tempf : files) { |
| 410 | statusList.add(tempf); |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | FileStatus[] statusArray = (FileStatus[]) statusList |
| 415 | .toArray(new FileStatus[statusList.size()]); |
| 416 | Path p = Utils.depthFirstSearchForFile(statusArray, fs, filter); |
| 417 | return p; |
| 418 | } |
| 419 | |
| 420 | @Override |
| 421 | public ResourceSchema getSchema(String location, Job job) |
no test coverage detected