public static string[] getFiles(string directory, bool recursively = false) { if (string.IsNullOrEmpty(directory)) { throw new ArgumentNullException("directory"); } string[] files = null; if (recursively) { List <string> list = new List <string>(1); TezFilePath.getFilesRecursively(directory, ref list); files = list.ToArray(); } else { files = Directory.GetFiles(directory); } for (int i = 0; i < files.Length; i++) { files[i] = TezFilePath.cleanPath(files[i]); } return(files); }
public static string[] getDirs(string path) { if (string.IsNullOrEmpty(path)) { throw new ArgumentNullException("directory"); } var dirs = Directory.GetDirectories(path); for (int i = 0; i < dirs.Length; i++) { dirs[i] = TezFilePath.cleanPath(dirs[i]); } return(dirs); }