LitDev.LDZip.Remove C# (CSharp) Method

Remove() public static method

Remove a file (or directory with all sub files) from an existing zip archive.
public static Remove ( Primitive zipFile, Primitive files ) : Primitive
zipFile Primitive The zip archive to remove a file from.
files Primitive /// An array of files to remove from the zip archive. /// A single file or directory may also be deleted. /// Any directories will be recursively removed from the zip. ///
return Primitive
        public static Primitive Remove(Primitive zipFile, Primitive files)
        {
            try
            {
                using (ZipFile zip = ZipFile.Read(zipFile))
                {
                    if (SBArray.IsArray(files))
                    {
                        Primitive indices = SBArray.GetAllIndices(files);
                        int count = SBArray.GetItemCount(indices);
                        for (int i = 1; i <= count; i++)
                        {
                            RemoveFromArchive(zip, files[indices[i]]);
                        }
                    }
                    else
                    {
                        RemoveFromArchive(zip, files);
                    }
                    zip.Save();
                }
                return "";
            }
            catch (Exception ex)
            {
                Utilities.OnError(Utilities.GetCurrentMethod(), ex);
                return Utilities.GetCurrentMethod() + " " + ex.Message;
            }
        }