code: private String getShortPath(String rootPath) {
          File file = new File(rootPath);
          String lastPathAfterSeparator = null;
          String shortPath = getWindowsShortPath(file.getAbsolutePath());
          if (StringUtils.isNotEmpty(shortPath)) {
              return getWindowsShortPath(file.getAbsolutePath());
          } else {
              while (StringUtils.isEmpty(getWindowsShortPath(file.getAbsolutePath()))) {
                  String filePath = file.getAbsolutePath();
                  if (StringUtils.isNotEmpty(lastPathAfterSeparator)) {
                      lastPathAfterSeparator = file.getAbsolutePath().substring(filePath.lastIndexOf(WINDOWS_SEPARATOR), filePath.length()) + lastPathAfterSeparator;
                  } else {
                      lastPathAfterSeparator = file.getAbsolutePath().substring(filePath.lastIndexOf(WINDOWS_SEPARATOR), filePath.length());
                  }
                  file = file.getParentFile();
              }
              return getWindowsShortPath(file.getAbsolutePath()) + lastPathAfterSeparator;
          }
      }
docs: get windows short path