question: private static UntarCompressionMethod compressionMethod ( File file ) { String fn = file . toString ( ) ; UntarCompressionMethod out = new UntarCompressionMethod ( ) ; if ( fn . endsWith ( "gz" ) ) { out . setValue ( "gzip" ) ; } else if ( fn . endsWith ( "bz2" ) ) { out . setValue ( "bzip2" ) ; } else if ( fn . endsWith ( "tar" ) ) { out . setValue ( "none" ) ; } else { throw new IllegalArgumentException ( "UntarJob doesn't know what to do with that file. " + "tar, gz, and bz2 files accepted." ) ; } return out ; }
target:  Internal convenience method determines the archive type from the filename extension.