private static String combinePaths ( List < String > paths ) { File file = new File ( paths . get ( 0 ) ) ; for ( int i = 1 ; i < paths . size ( ) ; i ++ ) { file = new File ( file , paths . get ( i ) ) ; } return file . getPath ( ) ; }
Given a list of strings concatenate them to form a file system path