private File extractThriftFile ( String artifactId , String fileName , Set < File > thriftFiles ) { for ( File thriftFile : thriftFiles ) { boolean fileFound = false ; if ( fileName . equals ( thriftFile . getName ( ) ) ) { for ( String pathComponent : thriftFile . getPath ( ) . split ( File . separator ) ) { if ( pathComponent . equals ( artifactId ) ) { fileFound = true ; } } } if ( fileFound ) { return thriftFile ; } } return null ; }
Picks out a File from thriftFiles corresponding to a given artifact ID and file name . Returns null if artifactId and fileName do not map to a thrift file path .