Ejemplo n.º 1
0
        public IPackageInfo Publish(string packageFileName, Stream packageStream)
        {
            var filePath = Path.Combine(BasePath, packageFileName + ".wrap");

            if (File.Exists(filePath))
                return null;
            using (var file = File.OpenWrite(filePath))
                packageStream.CopyTo(file);

            var newPackage = new ZipPackage(this, new FileInfo(filePath), GetCacheDirectory(filePath), ExportBuilders.All);
            Packages.Add(newPackage);
            return newPackage;
        }
Ejemplo n.º 2
0
        public IPackageInfo Publish(string packageFileName, Stream packageStream)
        {
            var wrapFile = BasePath.GetFile(packageFileName + ".wrap");
            if (wrapFile.Exists)
                return null;

            using (var file = wrapFile.OpenWrite())
                packageStream.CopyTo(file);

            var newPackage = new ZipPackage(this, wrapFile, _rootCacheDirectory.GetDirectory(wrapFile.NameWithoutExtension), ExportBuilders.All, _anchorsEnabled);
            Packages.Add(newPackage);
            return newPackage;
        }