/// <summary> /// Ensures the archive can be accessed. /// Since SharpCompress cannot check for encryption, we simply check for an access exception. /// </summary> /// <param name="Archive">A SharpCompress Archive object to validate</param> /// <returns>Whether the file can be accessed</returns> public static bool IsArchiveAccessible(SCA.IArchive scArch) { bool bAccessible = false; try { if (scArch.Entries.Count() >= 0) bAccessible = true; } catch { SQL.LogMessage("Tried to access encrypted archive", SQL.EventType.HandledException, scArch); } return bAccessible; }
/// <summary> /// Ensures the archive can be accessed. /// Since SharpCompress cannot check for encryption, we simply check for an access exception. /// </summary> /// <param name="Archive">A SharpCompress Archive object to validate</param> /// <returns>Whether the file can be accessed</returns> public static bool IsArchiveAccessible(SCA.IArchive scArch) { bool bAccessible = false; try { if (scArch.Entries.Count() >= 0) { bAccessible = true; } } catch { Console.WriteLine("Archive was inaccessible"); } return bAccessible; }