private static String canonicalHeaders ( Map < String , String > headers ) { StringBuilder canonical = new StringBuilder ( ) ; for ( Map . Entry < String , String > header : headers . entrySet ( ) ) { canonical . append ( header . getKey ( ) ) . append ( ' ' ) . append ( header . getValue ( ) ) . append ( ' ' ) ; } return canonical . toString ( ) ; }
Create canonical header set . The headers are ordered by name .