code: public static File toFile(FileObject fileObject) {
          if (fileObject instanceof LocalFile) {
              Method method = ReflectionUtils.getMethod(LocalFile.class, "getLocalFile");
              try {
                  method.setAccessible(true);
                  Object result = method.invoke(fileObject);
                  return (File) result;
              } catch (Exception e) {
                  throw new IllegalStateException(e);
              }
          }
          return null;
      }
docs: Converts (if possible) a {@link FileObject} to a {@link File}. Use with
  caution since {@link FileObject} is generally preferred.
  
  @param fileObject
  @return