public static String construct(String... urlParts){
  if (urlParts == null || urlParts.length == 0) {
    return "";
  }
  StringBuilder builder=new StringBuilder();
  String startingPart=removeStartingDash(urlParts[0]);
  startingPart=removeEndingDash(startingPart);
  if (!startingPart.startsWith("http")) {
    builder.append("http://");
  }
  builder.append(startingPart);
  for (int i=1, len=urlParts.length; i < len; i++) {
    String urlPart=removeEndingDash(urlParts[i]);
    if (!urlPart.startsWith("/")) {
      builder.append("/");
    }
    builder.append(urlPart);
  }
  return builder.toString();
}

public static String construct ( String ... urlParts ) { if ( urlParts == null || urlParts . length == 0 ) { return "" ; } StringBuilder builder = new StringBuilder ( ) ; String startingPart = removeStartingDash ( urlParts [ 0 ] ) ; startingPart = removeEndingDash ( startingPart ) ; if ( ! startingPart . startsWith ( "http" ) ) { builder . append ( "http://" ) ; } builder . append ( startingPart ) ; for ( int i = 1 , len = urlParts . length ; i < len ; i ++ ) { String urlPart = removeEndingDash ( urlParts [ i ] ) ; if ( ! urlPart . startsWith ( "/" ) ) { builder . append ( "/" ) ; } builder . append ( urlPart ) ; } return builder . toString ( ) ; }
construct url from the provided paths . doesn ' t support url parameters . only file path
