public static String byteArray2String ( byte [ ] [ ] pathComponents ) { if ( pathComponents . length == 0 ) return "" ; if ( pathComponents . length == 1 && pathComponents [ 0 ] . length == 0 ) { return Path . SEPARATOR ; } StringBuilder result = new StringBuilder ( ) ; for ( int i = 0 ; i < pathComponents . length ; i ++ ) { String converted = bytes2String ( pathComponents [ i ] ) ; if ( converted == null ) return null ; result . append ( converted ) ; if ( i < pathComponents . length - 1 ) { result . append ( Path . SEPARATOR_CHAR ) ; } } return result . toString ( ) ; }
Given a list of path components returns a path as a UTF8 String