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 ) ) ; } }
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 .