@VisibleForTesting void cleanOutputPath( Configuration conf ) throws IOException { if ( cleanOutputPath ) { FileSystem fs = hadoopShim.getFileSystem( conf ); Path path = getOutputPath( conf, fs ); String outputPath = path.toUri().toString(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, JOB_ENTRY_HADOOP_TRANS_JOB_EXECUTOR_CLEANING_OUTPUT_PATH, outputPath ) ); } try { if ( !fs.exists( path ) ) { // If the path does not exist one could think of it as "already cleaned" return; } if ( !fs.delete( path, true ) ) { if ( log.isBasic() ) { log.logBasic( BaseMessages .getString( PKG, JOB_ENTRY_HADOOP_TRANS_JOB_EXECUTOR_FAILED_TO_CLEAN_OUTPUT_PATH, outputPath ) ); } } } catch ( IOException ex ) { throw new IOException( BaseMessages.getString( PKG, JOB_ENTRY_HADOOP_TRANS_JOB_EXECUTOR_ERROR_CLEANING_OUTPUT_PATH, outputPath ), ex ); } } }