public static String newDomainUrl ( final String scheme , final String domainName , final int port , final boolean withServerPort , final boolean withSlashAtTheEnd ) { final StringBuilder domainUrl = new StringBuilder ( ) ; domainUrl . append ( scheme ) ; domainUrl . append ( "://" ) ; domainUrl . append ( domainName ) ; if ( withServerPort ) { domainUrl . append ( ":" ) ; domainUrl . append ( port ) ; } if ( withSlashAtTheEnd ) { domainUrl . append ( "/" ) ; } return domainUrl . toString ( ) ; }
Creates a new domain url from the given parameters .