Example #1
0
        public void CreatePackage(string packagePath, string inputPath, uint version = Package.CurrentVersion, CompressionMethod compression = CompressionMethod.None, bool fastCompression = true)
        {
            this.progressUpdate("Enumerating files ...", 0, 1);
            var package = new Package();

            EnumerateFiles(package, inputPath, inputPath);

            this.progressUpdate("Creating archive ...", 0, 1);
            var writer = new PackageWriter(package, packagePath);

            writer.writeProgress   += WriteProgressUpdate;
            writer.Version          = version;
            writer.Compression      = compression;
            writer.CompressionLevel = fastCompression ? LS.CompressionLevel.FastCompression : LS.CompressionLevel.DefaultCompression;
            writer.Write();
            writer.Dispose();
        }
Example #2
0
        public void CreatePackage(string packagePath, string inputPath, PackageVersion version = Package.CurrentVersion, CompressionMethod compression = CompressionMethod.None, bool fastCompression = true)
        {
            FileManager.TryToCreateDirectory(packagePath);

            ProgressUpdate("Enumerating files ...", 0, 1, null);
            Package package = CreatePackageFromPath(inputPath);

            ProgressUpdate("Creating archive ...", 0, 1, null);
            using (var writer = new PackageWriter(package, packagePath))
            {
                writer.WriteProgress   += WriteProgressUpdate;
                writer.Version          = version;
                writer.Compression      = compression;
                writer.CompressionLevel = fastCompression ? CompressionLevel.FastCompression : CompressionLevel.DefaultCompression;
                writer.Write();
            }
        }
        public void CreatePackage(string packagePath, string inputPath, PackageCreationOptions options)
        {
            FileManager.TryToCreateDirectory(packagePath);

            ProgressUpdate("Enumerating files ...", 0, 1, null);
            Package package = CreatePackageFromPath(inputPath);

            package.Metadata.Flags    = options.Flags;
            package.Metadata.Priority = options.Priority;

            ProgressUpdate("Creating archive ...", 0, 1, null);
            using (var writer = new PackageWriter(package, packagePath))
            {
                writer.WriteProgress   += WriteProgressUpdate;
                writer.Version          = options.Version;
                writer.Compression      = options.Compression;
                writer.CompressionLevel = options.FastCompression ? CompressionLevel.FastCompression : CompressionLevel.DefaultCompression;
                writer.Write();
            }
        }
Example #4
0
        public void CreatePackage(string packagePath, string inputPath, uint version = Package.CurrentVersion, CompressionMethod compression = CompressionMethod.None, bool fastCompression = true)
        {
            this.progressUpdate("Enumerating files ...", 0, 1);
            var package = new Package();
            EnumerateFiles(package, inputPath, inputPath);

            this.progressUpdate("Creating archive ...", 0, 1);
            var writer = new PackageWriter(package, packagePath);
            writer.writeProgress += WriteProgressUpdate;
            writer.Version = version;
            writer.Compression = compression;
            writer.CompressionLevel = fastCompression ? LS.CompressionLevel.FastCompression : LS.CompressionLevel.DefaultCompression;
            writer.Write();
            writer.Dispose();
        }