public int runAll ( ) { int exitCode = 0 ; if ( args == null ) { // no argument return run ( ) ; } for ( String src : args ) { try { Path srcPath = new Path ( src ) ; FileSystem fs = srcPath . getFileSystem ( getConf ( ) ) ; FileStatus [ ] statuses = fs . globStatus ( srcPath ) ; if ( statuses == null ) { System . err . println ( "Can not find listing for " + src ) ; exitCode = - 1 ; } else { for ( FileStatus s : statuses ) { try { run ( s . getPath ( ) ) ; } catch ( FileNotFoundException ex ) { // We are testing if the srcPath was given as a specific path // or as a mask. If it was a mask we skip the exception. // otherwise we have to propagate it if ( s . getPath ( ) . equals ( srcPath . makeQualified ( fs ) ) ) { throw ex ; } } } } } catch ( IOException e ) { exitCode = - 1 ; handleIOException ( e ) ; } } return exitCode ; }
For each source path execute the command