Пример #1
0
 public ZipFile(FileStream file)
 {
     this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     if (!file.CanSeek)
     {
         throw new ArgumentException("Stream is not seekable", "file");
     }
     this.baseStream_ = file;
     this.name_ = file.Name;
     this.isStreamOwner = true;
     try
     {
         this.ReadEntries();
     }
     catch
     {
         this.DisposeInternal(true);
         throw;
     }
 }
Пример #2
0
 public ZipFile(Stream stream)
 {
     this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     if (stream == null)
     {
         throw new ArgumentNullException("stream");
     }
     if (!stream.CanSeek)
     {
         throw new ArgumentException("Stream is not seekable", "stream");
     }
     this.baseStream_ = stream;
     this.isStreamOwner = true;
     if (this.baseStream_.Length > 0L)
     {
         try
         {
             this.ReadEntries();
             return;
         }
         catch
         {
             this.DisposeInternal(true);
             throw;
         }
     }
     this.entries_ = new ZipEntry[0];
     this.isNewArchive_ = true;
 }
Пример #3
0
 public ZipFile(Stream stream)
 {
     _useZip64 = UseZip64.Dynamic;
     _bufferSize = DefaultBufferSize;
     _updateEntryFactory = new ZipEntryFactory();
     if (stream == null)
     {
         throw new ArgumentNullException(nameof(stream));
     }
     if (!stream.CanSeek)
     {
         throw new ArgumentException("Stream is not seekable", nameof(stream));
     }
     _baseStream = stream;
     _isStreamOwner = true;
     if (_baseStream.Length > 0L)
     {
         try
         {
             ReadEntries();
             return;
         }
         catch
         {
             DisposeInternal(true);
             throw;
         }
     }
     _entries = new ZipEntry[0];
     _isNewArchive = true;
 }
Пример #4
0
 public ZipFile(Stream stream)
 {
     useZip64_ = UseZip64.Dynamic;
     bufferSize_ = DefaultBufferSize;
     updateEntryFactory_ = new ZipEntryFactory();
     if (stream == null)
     {
         throw new ArgumentNullException("stream");
     }
     if (!stream.CanSeek)
     {
         throw new ArgumentException("Stream is not seekable", "stream");
     }
     baseStream_ = stream;
     isStreamOwner = true;
     if (baseStream_.Length > 0L)
     {
         try
         {
             ReadEntries();
             return;
         }
         catch
         {
             DisposeInternal(true);
             throw;
         }
     }
     entries_ = new ZipEntry[0];
     isNewArchive_ = true;
 }
Пример #5
0
 public ZipFile(FileStream file)
 {
     _useZip64 = UseZip64.Dynamic;
     _bufferSize = DefaultBufferSize;
     _updateEntryFactory = new ZipEntryFactory();
     if (file == null)
     {
         throw new ArgumentNullException(nameof(file));
     }
     if (!file.CanSeek)
     {
         throw new ArgumentException("Stream is not seekable", nameof(file));
     }
     _baseStream = file;
     _name = file.Name;
     _isStreamOwner = true;
     try
     {
         ReadEntries();
     }
     catch
     {
         DisposeInternal(true);
         throw;
     }
 }
Пример #6
0
 public ZipFile(FileStream file)
 {
     useZip64_ = UseZip64.Dynamic;
     bufferSize_ = DefaultBufferSize;
     updateEntryFactory_ = new ZipEntryFactory();
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     if (!file.CanSeek)
     {
         throw new ArgumentException("Stream is not seekable", "file");
     }
     baseStream_ = file;
     name_ = file.Name;
     isStreamOwner = true;
     try
     {
         ReadEntries();
     }
     catch
     {
         DisposeInternal(true);
         throw;
     }
 }
Пример #7
0
 internal ZipFile()
 {
     this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     this.entries_ = new ZipEntry[0];
     this.isNewArchive_ = true;
 }
Пример #8
0
 internal ZipFile()
 {
     _useZip64 = UseZip64.Dynamic;
     _bufferSize = DefaultBufferSize;
     _updateEntryFactory = new ZipEntryFactory();
     _entries = new ZipEntry[0];
     _isNewArchive = true;
 }
Пример #9
0
 public TarInputStream(Stream inputStream, int blockSize, int recordSize)
 {
     this.inputStream = inputStream;
     this.buffer = TarBuffer.CreateInputTarBuffer(inputStream, blockSize, recordSize);
     this.readBuf = null;
     this.debug = false;
     this.hasHitEOF = false;
     this.eFactory = null;
 }
Пример #10
0
 /// <summary>
 /// Create from a file
 /// </summary>
 /// <param name="ef"></param>
 /// <param name="original"></param>
 /// <param name="ztime"></param>
 public ZipFSEntry(IEntryFactory ef, FileSystemInfo original, ZipTime ztime)
 {
     _ze = null;
     _ztime = ztime;
     if (original is FileInfo)
         _ze = ef.MakeFileEntry(original.FullName, true);
     else
     {
         string nobs = Utils.BackslashRemove(original.FullName);
         _ze = ef.MakeDirectoryEntry(nobs, true);
     }
 }
Пример #11
0
 internal ZipFile()
 {
     useZip64_ = UseZip64.Dynamic;
     bufferSize_ = DefaultBufferSize;
     updateEntryFactory_ = new ZipEntryFactory();
     entries_ = new ZipEntry[0];
     isNewArchive_ = true;
 }
Пример #12
0
 internal EmailLogger(string name, IEntryFactory <MailMessage> entryFactory, EmailEntryProcessor entryProcessor, IExternalScopeProvider scopeProvider)
     : base(name, entryFactory, entryProcessor ?? new EmailEntryProcessor(), scopeProvider)
 {
 }
Пример #13
0
 public void SetEntryFactory(IEntryFactory factory)
 {
     _entryFactory = factory;
 }
Пример #14
0
 public ZipFile(string name)
 {
     useZip64_ = UseZip64.Dynamic;
     bufferSize_ = DefaultBufferSize;
     updateEntryFactory_ = new ZipEntryFactory();
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     name_ = name;
     baseStream_ = File.Open(name, FileMode.Open, FileAccess.Read, FileShare.Read);
     isStreamOwner = true;
     try
     {
         ReadEntries();
     }
     catch
     {
         DisposeInternal(true);
         throw;
     }
 }
Пример #15
0
 /// <summary>
 /// Set the entry factory for this instance.
 /// </summary>
 /// <param name="factory">The factory for creating new entries</param>
 public void SetEntryFactory(IEntryFactory factory)
 {
     this.eFactory = factory;
 }
Пример #16
0
 public DiscordFetcher(IDiscordClient client, IEntryFactory <DiscordContact> entryFactory)
 {
     _client       = client;
     _entryFactory = entryFactory;
 }
Пример #17
0
 public FastZip(FastZipEvents events)
 {
     _entryFactory = new ZipEntryFactory();
     _useZip64 = UseZip64.Dynamic;
     _events = events;
 }
Пример #18
0
 public FastZip(FastZipEvents events)
 {
     this.entryFactory_ = new ZipEntryFactory();
     this.useZip64_     = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.events_       = events;
 }
Пример #19
0
 public FastZip(FastZipEvents events)
 {
     this.entryFactory_ = new ZipEntryFactory();
     this.events_       = events;
 }
Пример #20
0
 public FastZip()
 {
     this.entryFactory_ = new ZipEntryFactory();
 }
Пример #21
0
 /// <summary>
 /// Constructor for creating a <see cref="LoggerProviderBase{TLogger, TLoggerOptions, TEntryProcessor, TEntry}"/>
 /// </summary>
 /// <param name="options"><see cref="IOptions{TOptions}"/> to configure the loggers</param>
 /// <param name="entryFactory"><see cref="IEntryFactory{TEntry}"/> to create entries</param>
 /// <param name="entryProcessor"><see cref="IEntryProcessor{TEntry}"/> to persist entries</param>
 protected LoggerProviderBase(IOptionsMonitor <TLoggerOptions> options, IEntryFactory <TEntry> entryFactory, TEntryProcessor entryProcessor) : this(entryFactory, entryProcessor)
 {
     _optionsReloadToken = options.OnChange(ReloadLoggerOptions);
     ReloadLoggerOptions(options.CurrentValue);
 }
Пример #22
0
 public EmailLoggerProvider(IOptionsMonitor <EmailLoggerOptions> options, IEntryFactory <MailMessage> entryFactory) : base(options, entryFactory, new EmailEntryProcessor())
 {
     CreateOrUpdateClient();
 }
Пример #23
0
 public ZipFile(string name)
 {
     this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.bufferSize_ = 0x1000;
     this.updateEntryFactory_ = new ZipEntryFactory();
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     this.name_ = name;
     this.baseStream_ = File.Open(name, FileMode.Open, FileAccess.Read, FileShare.Read);
     this.isStreamOwner = true;
     try
     {
         this.ReadEntries();
     }
     catch
     {
         this.DisposeInternal(true);
         throw;
     }
 }
Пример #24
0
 public StoreEntryFactory(IEntryFactory baseEntryFactory)
 {
     _wrappedEntryFactory = baseEntryFactory;
 }
Пример #25
0
 public EntityFrameworkCoreLoggerProvider(IServiceProvider serviceProvider, IOptionsMonitor <EntityFrameworkCoreLoggerOptions> options, IEntryFactory <TEntry> entryFactory) : base(options, entryFactory, new EntityFrameworkCoreEntryProcessor <TContext, TEntry>(serviceProvider))
 {
     _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
 }
Пример #26
0
 public TwitterFetcher(ITwitterClient client, IEntryFactory <TwitterContact> entryFactory)
 {
     _client       = client;
     _entryFactory = entryFactory;
 }
Пример #27
0
 public FastZip()
 {
     _entryFactory = new ZipEntryFactory();
     _useZip64     = UseZip64.Dynamic;
 }
Пример #28
0
 private LoggerProviderBase(IEntryFactory <TEntry> entryFactory, TEntryProcessor entryProcessor)
 {
     _entryFactory   = entryFactory ?? throw new ArgumentNullException(nameof(entryFactory));
     _entryProcessor = entryProcessor ?? throw new ArgumentNullException(nameof(entryProcessor));
 }
Пример #29
0
 public ZipFile(string name)
 {
     _useZip64 = UseZip64.Dynamic;
     _bufferSize = DefaultBufferSize;
     _updateEntryFactory = new ZipEntryFactory();
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     _name = name;
     _baseStream = File.Open(name, FileMode.Open, FileAccess.Read, FileShare.Read);
     _isStreamOwner = true;
     try
     {
         ReadEntries();
     }
     catch
     {
         DisposeInternal(true);
         throw;
     }
 }
		/// <summary>
		/// Construct a TarInputStream with user specified block factor
		/// </summary>
		/// <param name="inputStream">stream to source data from</param>
		/// <param name="blockFactor">block factor to apply to archive</param>
		public TarInputStream(Stream inputStream, int blockFactor)
		{
			this.inputStream = inputStream;
			this.buffer      = TarBuffer.CreateInputTarBuffer(inputStream, blockFactor);
			
			this.readBuf   = null;
			this.hasHitEOF = false;
			this.eFactory  = null;
		}
Пример #31
0
 public FastZip()
 {
     entryFactory_ = new ZipEntryFactory();
     useZip64_ = UseZip64.Dynamic;
 }
Пример #32
0
 public FastZip(FastZipEvents events)
 {
     _entryFactory = new ZipEntryFactory();
     _useZip64     = UseZip64.Dynamic;
     _events       = events;
 }
Пример #33
0
 public FastZip(FastZipEvents events)
 {
     entryFactory_ = new ZipEntryFactory();
     useZip64_ = UseZip64.Dynamic;
     events_ = events;
 }
Пример #34
0
 public FastZip()
 {
     _entryFactory = new ZipEntryFactory();
     _useZip64 = UseZip64.Dynamic;
 }
Пример #35
0
 public FastZip(FastZipEvents events)
 {
     this.entryFactory_ = new ZipEntryFactory();
     this.useZip64_ = ICSharpCode.SharpZipLib.Zip.UseZip64.Dynamic;
     this.events_ = events;
 }
Пример #36
0
 public GitHubFetcher(IGitHubClient client, IEntryFactory <GitHubContact> entryFactory)
 {
     _client       = client;
     _entryFactory = entryFactory;
 }
Пример #37
0
 public EntryController(IEntryFactory entryFactory)
 {
     this._entryFactory = entryFactory;
 }
Пример #38
0
 /// <summary>
 /// Set the entry factory for this instance.
 /// </summary>
 /// <param name="factory">The factory for creating new entries</param>
 public void SetEntryFactory(IEntryFactory factory)
 {
     entryFactory = factory;
 }
Пример #39
0
 public EntrySerializer(IEntryFactory entryFactory)
 {
     this._entryFactory = entryFactory;
 }
Пример #40
0
 public void SetEntryFactory(IEntryFactory factory)
 {
     this.entryFactory = factory;
 }
 public EntityFrameworkCoreLoggerProvider(IServiceProvider serviceProvider, IOptionsMonitor <EntityFrameworkCoreLoggerOptions> options, IEntryFactory <Entry> entryFactory)
     : base(serviceProvider, options, entryFactory)
 {
 }