public static String createPath(String... elements){
  StringBuilder result=new StringBuilder();
  for (  String element : elements) {
    result.append(File.pathSeparator);
    result.append(element);
  }
  return result.toString();
}

public static String createPath ( String ... elements ) { StringBuilder result = new StringBuilder ( ) ; for ( String element : elements ) { result . append ( File . pathSeparator ) ; result . append ( element ) ; } return result . toString ( ) ; }
returns a command - line ready path formed by joining the path elements with the system path separator as a separator .
