public static String joinURL ( Map < URLParts , String > urlParts ) { try { URI uri = new URI ( urlParts . get ( URLParts . PROTOCOL ) , urlParts . get ( URLParts . AUTHORITY ) , urlParts . get ( URLParts . PATH ) , urlParts . get ( URLParts . QUERY ) , urlParts . get ( URLParts . REF ) ) ; return uri . toString ( ) ; } catch ( URISyntaxException ex ) { throw new RuntimeException ( ex ) ; } }
This method can be used to build a URL from its parts .