예제 #1
0
파일: Directory.cs 프로젝트: slagusev/api
        /// <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();
            }
        }
예제 #2
0
파일: Directory.cs 프로젝트: slagusev/api
        /// <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();
            }
        }
예제 #3
0
파일: Directory.cs 프로젝트: nguyenkien/api
 /// <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();
     }
 }
예제 #4
0
파일: Directory.cs 프로젝트: nguyenkien/api
 /// <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();
 }