public abstract Verbose ( string messageText ) : bool | ||
messageText | string | |
return | bool |
/// <summary> /// Finding the packages in the file repository /// </summary> /// <param name="openPackage">Delegate function which is actually finding a package</param> /// <param name="packageId">Package Id</param> /// <param name="packagePaths">File repository path</param> /// <param name="request"></param> /// <returns></returns> private static IEnumerable<IPackage> GetPackages(Func<string, Request, IPackage> openPackage, string packageId, IEnumerable<string> packagePaths, Request request) { request.Debug(Resources.Messages.DebugInfoCallMethod3, "LocalPackageRepository", "GetPackages", packageId); foreach (var path in packagePaths) { IPackage package = null; try { package = GetPackage(openPackage, path, request); } catch (InvalidOperationException ex) { // ignore error for unzipped packages (nuspec files). if (!string.Equals(NuGetConstant.ManifestExtension, Path.GetExtension(path), StringComparison.OrdinalIgnoreCase)) { request.Verbose(ex.Message); throw; } } if (package != null && package.Id.Equals(packageId, StringComparison.OrdinalIgnoreCase)) { yield return package; } } }
/// <summary> /// Find the package via the given uri query. /// </summary> /// <param name="query">A full Uri. A sample Uri looks like "http://www.nuget.org/api/v2/FindPackagesById()?id='Jquery'" </param> /// <param name="request">An object passed in from the PackageManagement that contains functions that can be used to interact with its Provider</param> /// <returns>Package objects</returns> internal static IEnumerable<PackageBase> FindPackage(string query, Request request) { request.Debug(Messages.DebugInfoCallMethod, "NuGetClient", "FindPackage"); request.Verbose(Messages.SearchingRepository, query, ""); return HttpClientPackageRepository.SendRequest(query, request); }
/// <summary> /// A delegate used for finding the package. /// </summary> /// <param name="path">File repository path</param> /// <param name="request"></param> /// <returns></returns> private static IPackage OpenPackage(string path, Request request) { request.Debug(Resources.Messages.DebugInfoCallMethod3, "LocalPackageRepository", "OpenPackage", path); if (!File.Exists(path)) { request.Warning(Resources.Messages.FileNotFound, path,"LocalPackageRepository::OpenPackage"); return null; } //deal with .nupkg if (string.Equals(Path.GetExtension(path), NuGetConstant.PackageExtension, StringComparison.OrdinalIgnoreCase)) { PackageBase package; try { package = ProcessZipPackage(path); } catch (Exception ex) { request.Verbose(ex.Message); throw; } // Set the last modified date on the package package.Published = FileUtility.GetLastModified(path); // We assume local files in the local repository are all latest version package.IsAbsoluteLatestVersion = true; package.IsLatestVersion = true; package.FullFilePath = path; return package; } return null; }