mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Make osu.Game + rulesets compile with netstandard
This commit is contained in:
33
osu.Game/Utils/ZipUtils.cs
Normal file
33
osu.Game/Utils/ZipUtils.cs
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user