Ejemplo n.º 1
0
        private void Close()
        {
            // Cleanup
            archive_stream.Close();
            archive_stream = null;
            get_next_entry = null;

            Finished();
        }
Ejemplo n.º 2
0
        private void SetupArchiveStream()
        {
            this.count      = 0;
            this.total_size = 0;

            switch (MimeType)
            {
            case "application/zip":
                archive_stream = new ZipInputStream(Stream);
                get_next_entry = GetNextEntryZip;
                archive_type   = "zip";
                break;

            case "application/x-bzip-compressed-tar":
                archive_stream = new TarInputStream(new BZip2InputStream(Stream));
                get_next_entry = GetNextEntryTar;
                archive_type   = "tar-bz2";
                break;

            case "application/x-compressed-tar":
            case "application/x-tgz":
                archive_stream = new TarInputStream(new GZipInputStream(Stream));
                get_next_entry = GetNextEntryTar;
                archive_type   = "tar-gz";
                break;

            case "application/x-tar":
                archive_stream = new TarInputStream(Stream);
                get_next_entry = GetNextEntryTar;
                archive_type   = "tar";
                break;

            case "application/x-gzip":
                archive_stream = new GZipInputStream(Stream);
                get_next_entry = GetNextEntrySingle;
                archive_type   = "gzip";
                break;

            case "application/x-bzip":
                archive_stream = new BZip2InputStream(Stream);
                get_next_entry = GetNextEntrySingle;
                archive_type   = "bz2";
                break;

            default:
                throw new ArgumentException("Invalid or unsupported mime type.");
            }

            setup_done = true;
        }
            public bool MoveNext()
            {
                if (GetNextEntry == null)
                    return false;

                this.Current = GetNextEntry();

                if (this.Current == null)
                {
                    this.GetNextEntry = null;
                    return false;
                }

                return true;
            }
            public bool MoveNext()
            {
                if (GetNextEntry == null)
                {
                    return(false);
                }

                this.Current = GetNextEntry();

                if (this.Current == null)
                {
                    this.GetNextEntry = null;
                    return(false);
                }

                return(true);
            }
Ejemplo n.º 5
0
		private void SetupArchiveStream ()
		{
			this.count = 0;
			this.total_size = 0;

			switch (MimeType) {
			case "application/zip":
				archive_stream = new ZipInputStream (Stream);
				get_next_entry = GetNextEntryZip;
				archive_type = "zip";
				break;

			case "application/x-bzip-compressed-tar":
				archive_stream = new TarInputStream (new BZip2InputStream (Stream));
				get_next_entry = GetNextEntryTar;
				archive_type = "tar-bz2";
				break;

			case "application/x-compressed-tar":
			case "application/x-tgz":
				archive_stream = new TarInputStream (new GZipInputStream (Stream));
				get_next_entry = GetNextEntryTar;
				archive_type = "tar-gz";
				break;

			case "application/x-tar":
				archive_stream = new TarInputStream (Stream);
				get_next_entry = GetNextEntryTar;
				archive_type = "tar";
				break;

			case "application/x-gzip":
				archive_stream = new GZipInputStream (Stream);
				get_next_entry = GetNextEntrySingle;
				archive_type = "gzip";
				break;

			case "application/x-bzip":
				archive_stream = new BZip2InputStream (Stream);
				get_next_entry = GetNextEntrySingle;
				archive_type = "bz2";
				break;

			default:
				throw new ArgumentException ("Invalid or unsupported mime type.");
			}

			setup_done = true;
		}
Ejemplo n.º 6
0
		private void Close ()
		{
			// Cleanup
			archive_stream.Close ();
			archive_stream = null;
			get_next_entry = null;

			Finished ();
		}