/// <summary> /// Delete the directory with the given path. /// </summary> public static void Delete(string path, bool recursive) { var file = new JFile(path); if (file.IsDirectory()) { if (recursive) { var children = file.List(); foreach (var child in children) { var childFile = new JFile(child); if (childFile.IsFile()) { childFile.Delete(); } if (childFile.IsDirectory()) { Delete(child, recursive); } } } file.Delete(); } }
/// <summary> /// Delete the directory with the given path. /// </summary> public static void Delete(string path) { var file = new JFile(path); if (file.IsDirectory()) { file.Delete(); } }
/// <summary> /// Delete the directory with the given path. /// </summary> public static void Delete(string path, bool recursive) { var file = new JFile(path); if (file.IsDirectory()) { if (recursive) { var children = file.List(); foreach (var child in children) { var childFile = new JFile(child); if (childFile.IsFile()) childFile.Delete(); if (childFile.IsDirectory()) Delete(child, recursive); } } file.Delete(); } }
/// <summary> /// Delete the directory with the given path. /// </summary> public static void Delete(string path) { var file = new JFile(path); if (file.IsDirectory()) file.Delete(); }