1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:07:33 +08:00
osu-lazer/osu.Game/Utils/ZipUtils.cs

34 lines
811 B
C#
Raw Normal View History

2018-04-13 17:19:50 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using SharpCompress.Archives.Zip;
namespace osu.Game.Utils
{
public static class ZipUtils
{
public static bool IsZipArchive(string path)
{
try
{
using (var arc = ZipArchive.Open(path))
{
foreach (var entry in arc.Entries)
{
using (entry.OpenEntryStream())
{
}
}
}
return true;
}
catch (Exception)
{
return false;
}
}
}
}