Exemplo n.º 1
0
        bool isStream = false;  // whether the file is passed in with stream, no means passed in with string path

        /**
         * Constructor. Creates a new ZipPackage.
         */
        public ZipPackage()
            : base(defaultPackageAccess)
        {
            this.zipArchive = null;
            try
            {
                this.contentTypeManager = new ZipContentTypeManager(null, this);
            }
            catch (InvalidFormatException e) { }
        }
Exemplo n.º 2
0
 /**
  * Constructor. Creates a new ZipPackage.
  */
 public ZipPackage()
     : base(defaultPackageAccess)
 {
     this.zipArchive = null;
     try
     {
         this.contentTypeManager = new ZipContentTypeManager(null, this);
     }
     catch (InvalidFormatException e) { }
 }
Exemplo n.º 3
0
        /**
         * Constructor. Opens a Zip based Open XML document.
         *
         * @param path
         *            The path of the file to open or create.
         * @param access
         *            The package access mode.
         * @throws InvalidFormatException
         *             If the content type part parsing encounters an error.
         */
        public ZipPackage(String path, PackageAccess access)
            : base(access)
        {


            ZipFile zipFile = ZipHelper.OpenZipFile(path);
            if (zipFile == null)
                throw new InvalidOperationException(
                        "Can't open the specified file: '" + path + "'");
            this.zipArchive = new ZipFileZipEntrySource(zipFile);
        }
Exemplo n.º 4
0
        /**
         * Constructor. Opens a Zip based Open XML document.
         *
         * @param path
         *            The path of the file to open or create.
         * @param access
         *            The package access mode.
         * @throws InvalidFormatException
         *             If the content type part parsing encounters an error.
         */
        public ZipPackage(String path, PackageAccess access)
            : base(access)
        {
            ZipFile zipFile = ZipHelper.OpenZipFile(path);

            if (zipFile == null)
            {
                throw new InvalidOperationException(
                          "Can't open the specified file: '" + path + "'");
            }
            this.zipArchive = new ZipFileZipEntrySource(zipFile);
        }
Exemplo n.º 5
0
        bool isStream = false;  // whether the file is passed in with stream, no means passed in with string path

        /**
         * Constructor. Creates a new ZipPackage.
         */
        public ZipPackage()
            : base(defaultPackageAccess)
        {
            this.zipArchive = null;
            try
            {
                this.contentTypeManager = new ZipContentTypeManager(null, this);
            }
            // ElectricSquare: The value e is declared but never used
            // catch (InvalidFormatException e) { }
            catch (InvalidFormatException) { }
            // ElectricSquare
        }
Exemplo n.º 6
0
        /**
         * Constructor. Opens a Zip based Open XML document.
         *
         * @param file
         *            The file to open or create.
         * @param access
         *            The package access mode.
         * @throws InvalidFormatException
         *             If the content type part parsing encounters an error.
         */
        public ZipPackage(FileInfo file, PackageAccess access)
            : base(access)
        {
            ZipFile zipFile = null;

            try
            {
                zipFile = ZipHelper.OpenZipFile(file);
            }
            catch (IOException e)
            {
                throw new InvalidOperationException(
                          "Can't open the specified file: '" + file + "'", e);
            }

            this.zipArchive = new ZipFileZipEntrySource(zipFile);
        }
Exemplo n.º 7
0
        /**
         * Constructor. Opens a Zip based Open XML document.
         *
         * @param file
         *            The file to open or create.
         * @param access
         *            The package access mode.
         * @throws InvalidFormatException
         *             If the content type part parsing encounters an error.
         */
        public ZipPackage(FileInfo file, PackageAccess access)
            : base(access)
        {


            ZipFile zipFile = null;

            try
            {
                zipFile = ZipHelper.OpenZipFile(file);
            }
            catch (IOException e)
            {
                throw new InvalidOperationException(
                      "Can't open the specified file: '" + file + "'", e);
            }

            this.zipArchive = new ZipFileZipEntrySource(zipFile);
        }
Exemplo n.º 8
0
 /**
  * Constructor. <b>Operation not supported.</b>
  *
  * @param in
  *            Zip input stream to load.
  * @param access
  * @throws ArgumentException
  *             If the specified input stream not an instance of
  *             ZipInputStream.
  */
 public ZipPackage(Stream in1, PackageAccess access)
     : base(access)
 {
     this.zipArchive = new ZipInputStreamZipEntrySource(new ZipInputStream(in1));
 }
Exemplo n.º 9
0
 /**
  * Constructor. <b>Operation not supported.</b>
  *
  * @param in
  *            Zip input stream to load.
  * @param access
  * @throws ArgumentException
  *             If the specified input stream not an instance of
  *             ZipInputStream.
  */
 public ZipPackage(Stream in1, PackageAccess access)
     : base(access)
 {
     this.zipArchive = new ZipInputStreamZipEntrySource(new ZipInputStream(in1));
 }
Exemplo n.º 10
0
 /**
  * Constructor. Creates a new ZipPackage.
  */
 public ZipPackage()
     : base(defaultPackageAccess)
 {
     this.zipArchive = null;
 }
Exemplo n.º 11
0
 /**
  * Constructor. Creates a new ZipPackage.
  */
 public ZipPackage()
     : base(defaultPackageAccess)
 {
     this.zipArchive = null;
 }
Exemplo n.º 12
0
 /**
  * Constructor. <b>Operation not supported.</b>
  *
  * @param in
  *            Zip input stream to load.
  * @param access
  * @throws ArgumentException
  *             If the specified input stream not an instance of
  *             ZipInputStream.
  */
 public ZipPackage(Stream filestream, PackageAccess access)
     : base(access)
 {
     isStream        = true;
     this.zipArchive = new ZipInputStreamZipEntrySource(new ZipInputStream(filestream));
 }
Exemplo n.º 13
0
 /**
  * Constructor. <b>Operation not supported.</b>
  *
  * @param in
  *            Zip input stream to load.
  * @param access
  * @throws ArgumentException
  *             If the specified input stream not an instance of
  *             ZipInputStream.
  */
 public ZipPackage(Stream filestream, PackageAccess access)
     : base(access)
 {
     isStream = true;
     this.zipArchive = new ZipInputStreamZipEntrySource(new ZipInputStream(filestream));
 }