Esempio 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) { }
        }
Esempio 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) { }
 }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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));
 }
Esempio 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));
 }
Esempio n. 10
0
 /**
  * Constructor. Creates a new ZipPackage.
  */
 public ZipPackage()
     : base(defaultPackageAccess)
 {
     this.zipArchive = null;
 }
Esempio n. 11
0
 /**
  * Constructor. Creates a new ZipPackage.
  */
 public ZipPackage()
     : base(defaultPackageAccess)
 {
     this.zipArchive = null;
 }
Esempio 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));
 }
Esempio 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));
 }