Files
ICD.Common.Utils/ICD.Common/Utils/IO/IcdDirectory.cs
2017-06-21 22:41:54 -04:00

70 lines
1.3 KiB
C#

using System;
#if SIMPLSHARP
using Crestron.SimplSharp.CrestronIO;
#else
using System.IO;
#endif
namespace ICD.Common.Utils.IO
{
public static class IcdDirectory
{
public static string GetApplicationDirectory()
{
#if SIMPLSHARP
return Directory.GetApplicationDirectory();
#else
return Directory.GetCurrentDirectory();
#endif
}
public static bool Exists(string path)
{
if (path == null)
throw new ArgumentNullException("path");
return Directory.Exists(path);
}
public static string[] GetFiles(string path)
{
if (path == null)
throw new ArgumentNullException("path");
return Directory.GetFiles(path);
}
public static string[] GetDirectories(string path)
{
if (path == null)
throw new ArgumentNullException("path");
return Directory.GetDirectories(path);
}
public static void Delete(string path, bool recursive)
{
if (path == null)
throw new ArgumentNullException("path");
Directory.Delete(path, recursive);
}
public static void CreateDirectory(string path)
{
if (path == null)
throw new ArgumentNullException("path");
Directory.CreateDirectory(path);
}
public static string GetDirectoryRoot(string path)
{
if (path == null)
throw new ArgumentNullException("path");
return Directory.GetDirectoryRoot(path);
}
}
}