class RepositoryFileServiceImpl implements RepositoryFileService {

	@Override
	public Optional<RepositoryFile> findReadme(Integer projectId) {
		return repositoryResourceDao.findByRepositoryIdAndParentIdAndResourceTypeAndAppTypeAndKeyIgnoreCase(
				projectId, 
				Constant.TREE_ROOT_ID,
				RepositoryResourceType.FILE,
				AppType.UNKNOWN,
				RepositoryResource.README_KEY)
			.flatMap(resource -> {
				return repositoryFileDao.findByRepositoryResourceId(resource.getId());
			});
	}

}