code: public Optional<RepositoryFile> getOptionalFileInfo(Object projectIdOrPath, String filePath, String ref) {
          try {
              return (Optional.ofNullable(getFileInfo(projectIdOrPath, filePath, ref)));
          } catch (GitLabApiException glae) {
              return (GitLabApi.createOptionalFromException(glae));
          }
      }
docs: Get an Optional instance with the value holding information on a file in the repository.
  Allows you to receive information about file in repository like name, size.
  Only works with GitLab 11.1.0+, value will be an empty object for earlier versions of GitLab.
  
  <pre><code>GitLab Endpoint: HEAD /projects/:id/repository/files</code></pre>
  
  @param projectIdOrPath the id, path of the project, or a Project instance holding the project ID or path
  @param filePath (required) - Full path to the file. Ex. lib/class.rb
  @param ref (required) - The name of branch, tag or commit
  @return an Optional instance with the specified RepositoryFile as a value
  @since GitLab-11.1.0