private Path getFinalPath ( Path jobOutputDir , Path taskOutput , Path taskOutputPath ) throws IOException { URI taskOutputUri = taskOutput . toUri ( ) ; URI relativePath = taskOutputPath . toUri ( ) . relativize ( taskOutputUri ) ; if ( taskOutputUri == relativePath ) { throw new IOException ( "Can not get the relative path: base = " + taskOutputPath + " child = " + taskOutput ) ; } if ( relativePath . getPath ( ) . length ( ) > 0 ) { return new Path ( jobOutputDir , relativePath . getPath ( ) ) ; } else { return jobOutputDir ; } }
Find the final name of a given output file given the job output directory and the work directory .