question: public static List < String > splitPath ( File file ) { List < String > output = new ArrayList < > ( ) ; File current = file ; while ( current != null ) { output . add ( current . getName ( ) ) ; current = current . getParentFile ( ) ; } Collections . reverse ( output ) ; return output ; }
target:  Split a file into a list of directories ending with the file name