private static String getFileName(File current) {
    String result = current.getName();
    if (!result.isEmpty()) return result;
    String path = current.getPath();
    return path.substring(0, path.length() - 1);
  }
private static String getFileName(File current)