Using the picard htsjdk api to read the sample name from the bam header.