Esempio n. 1
0
        public ZipBundleReader(
            IZipFileReaderWrapper zipFileReaderWrapper,
            ICheckSumGenerator checkSumGenerator,
            ILogger logger,
            IFileSystem fileSystem,
            ISerializeWrapper serializeWrapper)
        {
            if (zipFileReaderWrapper == null)
                throw new ArgumentNullException("zipFileReaderWrapper");

            if (checkSumGenerator == null)
                throw new ArgumentNullException("checkSumGenerator");

            if (logger == null)
                throw new ArgumentNullException("logger");

            if (fileSystem == null)
                throw new ArgumentNullException("fileSystem");

            if (serializeWrapper == null)
                throw new ArgumentNullException("serializeWrapper");

            this.mZipFileReaderWrapper = zipFileReaderWrapper;
            this.mCheckSumGenerator = checkSumGenerator;
            this.mLogger = logger;
            this.mFileSystem = fileSystem;
            this.mSerializeWrapper = serializeWrapper;

            // Register event for when entries are extracted using the IZipFileReaderWrapper
            this.mZipFileReaderWrapper.OnEntryExtracted += EntryExtractedEventHandler;

            this.mSummary = new BundleSummary();
        }
Esempio n. 2
0
        public ZipBundleReader(
            string fileName,
            string unpackDirectory,
            IZipFileReaderWrapper zipFileReaderWrapper,
            ICheckSumGenerator checkSumGenerator,
            ILogger logger,
            IFileSystem fileSystem,
            ISerializeWrapper serializeWrapper)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentException("fileName");
            }

            if (string.IsNullOrEmpty(unpackDirectory))
            {
                throw new ArgumentException("unpackDirectory");
            }

            if (zipFileReaderWrapper == null)
            {
                throw new ArgumentNullException("zipFileReaderWrapper");
            }

            if (checkSumGenerator == null)
            {
                throw new ArgumentNullException("checkSumGenerator");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }

            if (serializeWrapper == null)
            {
                throw new ArgumentNullException("serializeWrapper");
            }

            this.mFileName                      = fileName;
            this.mUnpackDirectory               = unpackDirectory;
            this.mZipFileReaderWrapper          = zipFileReaderWrapper;
            this.mZipFileReaderWrapper.FileName = fileName;
            this.mCheckSumGenerator             = checkSumGenerator;
            this.mLogger     = logger;
            this.mFileSystem = fileSystem;
            this.mZipFileReaderWrapper.UnPackDirectory = unpackDirectory;
            this.mZipFileReaderWrapper.FileName        = fileName;
            this.mSerializeWrapper = serializeWrapper;

            // Register event for when entries are extracted using the IZipFileReaderWrapper
            this.mZipFileReaderWrapper.OnEntryExtracted += EntryExtractedEventHandler;

            this.mSummary = new BundleSummary();
        }
Esempio n. 3
0
        public ZipBundler(
            IZipFileWrapper zipFileWrapper,
            ICheckSumGenerator checkSumGenerator,
            ILogger logger,
            ISerializeWrapper serializeWrapper)
        {
            if (zipFileWrapper == null)
            {
                throw new ArgumentNullException("zipFileWrapper");
            }

            if (checkSumGenerator == null)
            {
                throw new ArgumentNullException("checkSumGenerator");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (serializeWrapper == null)
            {
                throw new ArgumentNullException("serializeWrapper");
            }

            this.mZipFileWrapper    = zipFileWrapper;
            this.mCheckSumGenerator = checkSumGenerator;
            this.mLogger            = logger;
            this.mSerializeWrapper  = serializeWrapper;

            this.mSummary = new BundleSummary();
        }
Esempio n. 4
0
        public void ReadExportSummary()
        {
            this.mLogger.Debug("ReadExportSummary - Reading summary from entry '{0}' in bundle '{1}'...", this.mExportSummaryFilename, this.mFileName);

            string exportSummary = this.mZipFileReaderWrapper.ReadEntry(this.mExportSummaryFilename);

            if (string.IsNullOrEmpty(exportSummary))
            {
                throw new Exception("No data in export summary.");
            }

            this.mLogger.Debug("ReadExportSummary - Summary = {0}", exportSummary);

            this.mSummary = this.mSerializeWrapper.DeserializeObject <BundleSummary>(exportSummary);
        }
Esempio n. 5
0
        public ZipBundleReader(
            IZipFileReaderWrapper zipFileReaderWrapper,
            ICheckSumGenerator checkSumGenerator,
            ILogger logger,
            IFileSystem fileSystem,
            ISerializeWrapper serializeWrapper)
        {
            if (zipFileReaderWrapper == null)
            {
                throw new ArgumentNullException("zipFileReaderWrapper");
            }

            if (checkSumGenerator == null)
            {
                throw new ArgumentNullException("checkSumGenerator");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }

            if (serializeWrapper == null)
            {
                throw new ArgumentNullException("serializeWrapper");
            }

            this.mZipFileReaderWrapper = zipFileReaderWrapper;
            this.mCheckSumGenerator    = checkSumGenerator;
            this.mLogger           = logger;
            this.mFileSystem       = fileSystem;
            this.mSerializeWrapper = serializeWrapper;

            // Register event for when entries are extracted using the IZipFileReaderWrapper
            this.mZipFileReaderWrapper.OnEntryExtracted += EntryExtractedEventHandler;

            this.mSummary = new BundleSummary();
        }
Esempio n. 6
0
        public ZipBundleReader(
            string fileName,
            string unpackDirectory,
            IZipFileReaderWrapper zipFileReaderWrapper,
            ICheckSumGenerator checkSumGenerator,
            ILogger logger,
            IFileSystem fileSystem,
            ISerializeWrapper serializeWrapper)
        {
            if (string.IsNullOrEmpty(fileName))
                throw new ArgumentException("fileName");

            if (string.IsNullOrEmpty(unpackDirectory))
                throw new ArgumentException("unpackDirectory");

            if (zipFileReaderWrapper == null)
                throw new ArgumentNullException("zipFileReaderWrapper");

            if (checkSumGenerator == null)
                throw new ArgumentNullException("checkSumGenerator");

            if (logger == null)
                throw new ArgumentNullException("logger");

            if (fileSystem == null)
                throw new ArgumentNullException("fileSystem");

            if (serializeWrapper == null)
                throw new ArgumentNullException("serializeWrapper");

            this.mFileName = fileName;
            this.mUnpackDirectory = unpackDirectory;
            this.mZipFileReaderWrapper = zipFileReaderWrapper;
            this.mZipFileReaderWrapper.FileName = fileName;
            this.mCheckSumGenerator = checkSumGenerator;
            this.mLogger = logger;
            this.mFileSystem = fileSystem;
            this.mZipFileReaderWrapper.UnPackDirectory = unpackDirectory;
            this.mZipFileReaderWrapper.FileName = fileName;
            this.mSerializeWrapper = serializeWrapper;

            // Register event for when entries are extracted using the IZipFileReaderWrapper
            this.mZipFileReaderWrapper.OnEntryExtracted += EntryExtractedEventHandler;

            this.mSummary = new BundleSummary();
        }
Esempio n. 7
0
        public void ReadExportSummary()
        {
            this.mLogger.Debug("ReadExportSummary - Reading summary from entry '{0}' in bundle '{1}'...", this.mExportSummaryFilename, this.mFileName);

            string exportSummary = this.mZipFileReaderWrapper.ReadEntry(this.mExportSummaryFilename);

            if (string.IsNullOrEmpty(exportSummary))
                throw new Exception("No data in export summary.");

            this.mLogger.Debug("ReadExportSummary - Summary = {0}", exportSummary);

            this.mSummary = this.mSerializeWrapper.DeserializeObject<BundleSummary>(exportSummary);
        }
Esempio n. 8
0
        public ZipBundler(
            IZipFileWrapper zipFileWrapper,
            ICheckSumGenerator checkSumGenerator,
            ILogger logger,
            ISerializeWrapper serializeWrapper)
        {
            if (zipFileWrapper == null)
                throw new ArgumentNullException("zipFileWrapper");

            if (checkSumGenerator == null)
                throw new ArgumentNullException("checkSumGenerator");

            if (logger == null)
                throw new ArgumentNullException("logger");

            if (serializeWrapper == null)
                throw new ArgumentNullException("serializeWrapper");

            this.mZipFileWrapper = zipFileWrapper;
            this.mCheckSumGenerator = checkSumGenerator;
            this.mLogger = logger;
            this.mSerializeWrapper = serializeWrapper;

            this.mSummary = new BundleSummary();
        }