private Properties createProperties ( Properties propertyNames ) { Properties props = new Properties ( ) ; for ( String key : propertiesArray ) { if ( sessionProperties . get ( key ) != null ) { if ( ! key . equalsIgnoreCase ( STOREPROTOCOLCLASSNAME ) && ! key . equalsIgnoreCase ( TRANSPORTPROTOCOLCLASSNAME ) ) { props . put ( key , sessionProperties . get ( key ) ) ; if ( propertyNames . getProperty ( key ) != null ) props . put ( propertyNames . getProperty ( key ) , sessionProperties . get ( key ) ) ; } else { if ( key . equalsIgnoreCase ( STOREPROTOCOLCLASSNAME ) ) props . put ( "mail." + props . getProperty ( STOREPROTOCOL ) + ".class" , sessionProperties . get ( key ) ) ; else props . put ( "mail." + props . getProperty ( TRANSPORTPROTOCOL ) + ".class" , sessionProperties . get ( key ) ) ; } } } return props ; }
The createProperties method will iterate through the sessionProperties and put them into the props object so that it can be used to create the javax . mail . Session