/// <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(); } }
private Java.Io.File[] GetEntries(string path) { var dir = new Java.Io.File(path); if (dir.Exists() && dir.IsDirectory()) { var entries = dir.ListFiles(); if (entries != null) { var list = entries.OrderBy(x => x.Name).ToList(); if (path != startPath) { var parent = dir.ParentFile; if (parent != null) { list.Insert(0, parent); } } return list.ToArray(); } } return new Java.Io.File[0]; }
private Java.Io.File[] GetEntries(string path) { var dir = new Java.Io.File(path); if (dir.Exists() && dir.IsDirectory()) { var entries = dir.ListFiles(); if (entries != null) { var list = entries.OrderBy(x => x.Name).ToList(); if (path != startPath) { var parent = dir.ParentFile; if (parent != null) { list.Insert(0, parent); } } return(list.ToArray()); } } return(new Java.Io.File[0]); }
/// <summary> /// Does a directory with given path exist on the filesystem? /// </summary> public static bool Exists(string path) { var file = new JFile(path); return(file.IsDirectory() && file.Exists()); }
/// <summary> /// Does a directory with given path exist on the filesystem? /// </summary> public static bool Exists(string path) { var file = new JFile(path); return file.IsDirectory() && file.Exists(); }
/// <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(); }