/// <summary>
        /// Gets the directory that the package (specified by packageLocation)
        /// would be cached into.
        /// </summary>
        /// <param name="cachePath">The folder to use for a cache of all SharePoint files.</param>
        /// <param name="impersonationBehavior">The impersonation behaviour to use.</param>
        /// <param name="packageLocation">The package loacation in LearningStore format.</param>
        /// <returns>The directory path to the cached package.</returns>
        internal static string GetCacheDirectory(string cachePath, ImpersonationBehavior impersonationBehavior, string packageLocation)
        {
            SharePointFileLocation location;

            if (!SharePointFileLocation.TryParse(packageLocation, out location))
            {
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Resources.SPFormatInvalid, packageLocation));
            }

            return(SharePointPackageReader.GetCacheDirectory(cachePath, impersonationBehavior, location));
        }
        /// <summary>
        /// Constructor. Accesses all SharePoint files with elevated privilege.
        /// </summary>
        /// <param name="packageStore">The PackageStore that contains information about the package.</param>
        /// <param name="packageId">The package id of the package to load.</param>
        /// <param name="packageLocation">The location of the package, as defined in
        /// LearningStore PackageItem.Location column. This cannot be null.</param>
        /// <remarks></remarks>
        internal SharePointPackageStoreReader(SharePointPackageStore packageStore, PackageItemIdentifier packageId, string packageLocation)
        {
            Resources.Culture = Thread.CurrentThread.CurrentCulture;
            Utilities.ValidateParameterNotEmpty("packageLocation", packageLocation);

            m_store     = packageStore;
            m_packageId = packageId;

            SharePointFileLocation location;

            if (!SharePointFileLocation.TryParse(packageLocation, out location))
            {
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, Resources.SPFormatInvalid, packageLocation));
            }

            CreatePackageReader(location);
        }