private Uri GetModuleFileUri(OciArtifactModuleReference reference, ModuleFileType fileType) { string localFilePath = this.GetModuleFilePath(reference, fileType); if (Uri.TryCreate(localFilePath, UriKind.Absolute, out var uri)) { return uri; } throw new NotImplementedException($"Local module file path is malformed: \"{localFilePath}\""); }
private string GetModuleFilePath(OciArtifactModuleReference reference, ModuleFileType fileType) { var fileName = fileType switch { ModuleFileType.ModuleMain => "main.json", ModuleFileType.Lock => "lock", ModuleFileType.Manifest => "manifest", ModuleFileType.Metadata => "metadata", _ => throw new NotImplementedException($"Unexpected module file type '{fileType}'.") }; return(Path.Combine(this.GetModuleDirectoryPath(reference), fileName)); }