|
@@ -1559,7 +1559,11 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
GlobFilter fp = new GlobFilter(components[components.length - 1], filter);
|
|
|
if (fp.hasPattern()) { // last component has a pattern
|
|
|
// list parent directories and then glob the results
|
|
|
- results = listStatus(parentPaths, fp);
|
|
|
+ try {
|
|
|
+ results = listStatus(parentPaths, fp);
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
+ results = null;
|
|
|
+ }
|
|
|
hasGlob[0] = true;
|
|
|
} else { // last component does not have a pattern
|
|
|
// remove the quoting of metachars in a non-regexp expansion
|
|
@@ -1608,7 +1612,11 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
}
|
|
|
GlobFilter fp = new GlobFilter(filePattern[level]);
|
|
|
if (fp.hasPattern()) {
|
|
|
- parents = FileUtil.stat2Paths(listStatus(parents, fp));
|
|
|
+ try {
|
|
|
+ parents = FileUtil.stat2Paths(listStatus(parents, fp));
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
+ parents = null;
|
|
|
+ }
|
|
|
hasGlob[0] = true;
|
|
|
} else { // the component does not have a pattern
|
|
|
// remove the quoting of metachars in a non-regexp expansion
|