public static boolean fileSizeIsGreaterThan(@NotNull VirtualFile vFile, long maxBytes) {
    if (vFile instanceof LightVirtualFile && !vFile.getFileType().isBinary()) {
      // this is an optimization to avoid conversion of [large] file contents to bytes
      int lengthInChars = ((LightVirtualFile)vFile).getContent().length();
      if (lengthInChars < maxBytes / 2) {
        return false;
      }
      if (lengthInChars > maxBytes ) {
        return true;
      }
    }

    return vFile.getLength() > maxBytes;
  }
public static boolean fileSizeIsGreaterThan(@NotNull VirtualFile vFile, long maxBytes)