Exemplo n.º 1
0
 public Package CreateNewFromFile(string pathToPackageFile)
 {
     long packageFileSize;
     using (FileStream packageFileStream = _fileSystem.OpenRead(pathToPackageFile))
     {
         packageFileSize = packageFileStream.Length;
     }
     IZipPackage zipPackage = new NuPackZipPackage(new ZipPackage(pathToPackageFile));
     DateTime currentTime = _dateTime.UtcNow;
     Package package = _packageMapper.Map(zipPackage);
     package.PackageSize = packageFileSize;
     package.Created = currentTime;
     package.LastUpdated = currentTime;
     package.Tags = zipPackage.Tags;
     return package;
 }
Exemplo n.º 2
0
        public Package CreateNewFromFile(string pathToPackageFile)
        {
            long packageFileSize;

            using (FileStream packageFileStream = _fileSystem.OpenRead(pathToPackageFile))
            {
                packageFileSize = packageFileStream.Length;
            }
            IZipPackage zipPackage  = new NuPackZipPackage(new ZipPackage(pathToPackageFile));
            DateTime    currentTime = _dateTime.UtcNow;
            Package     package     = _packageMapper.Map(zipPackage);

            package.PackageSize = packageFileSize;
            package.Created     = currentTime;
            package.LastUpdated = currentTime;
            package.Tags        = zipPackage.Tags;
            return(package);
        }