private static ArrayList<String> getComponents(File file) {
    ArrayList<String> result = new ArrayList<>();
    File current = file;
    while (current != null) {
      result.add(getFileName(current));
      current = current.getParentFile();
      if (current != null) result.add(File.separator);
    }
    return result;
  }
private static ArrayList<String> getComponents(File file)