code: private static List<String> getPathList(File file) throws IOException {
          //Make sure the canonical file is being parsed
          file = file.getCanonicalFile();
  
          //Build a List of the parts of the path
          final List<String> pathParts = new LinkedList<String>();
          while (file != null) {
              pathParts.add(file.getName());
              file = file.getParentFile();
          }
          
          return pathParts;
      }
docs: break a path down into individual elements and add to a list.
  example : if a path is /a/b/c/d.txt, the breakdown will be [d.txt,c,b,a]
  @param file input file
  @return a List collection with the individual elements of the path in reverse order