You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/06/11 21:27:00 UTC

[jira] [Commented] (REEF-2037) DeleteDirectory of LocalFileSystem does not do recursive delete unlike other filesystem implementations

    [ https://issues.apache.org/jira/browse/REEF-2037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16508781#comment-16508781 ] 

ASF GitHub Bot commented on REEF-2037:
--------------------------------------

tyclintw commented on a change in pull request #1474: [REEF-2037] Make local file system deleteDirectory api recursive
URL: https://github.com/apache/reef/pull/1474#discussion_r194553352
 
 

 ##########
 File path: lang/cs/Org.Apache.REEF.IO.Tests/TestLocalFileSystem.cs
 ##########
 @@ -157,6 +157,27 @@ public void TestGetChildren()
             fs.DeleteDirectory(directoryUri);
         }
 
+        [Fact]
+        public void TestDeleteDirectory()
+        {
+            var fs = GetFileSystem();
+            var directoryUri = new Uri(Path.Combine(Path.GetTempPath(), TempFileName) + "/");
+            string childDirName = "childDir";
+            const string fileName = "testfile";
+            fs.CreateDirectory(directoryUri);
+            var childDirUri = new Uri(directoryUri, childDirName);
+            fs.CreateDirectory(childDirUri);
+            var fileUri = new Uri(directoryUri, fileName);
+            MakeRemoteTestFile(fs, fileUri);
+            var childDirFileUri = new Uri(directoryUri, $"{childDirName}/{fileName}");
+            MakeRemoteTestFile(fs, childDirFileUri);
+            fs.DeleteDirectory(directoryUri);
+            Assert.False(File.Exists(childDirFileUri.AbsolutePath));
+            Assert.False(File.Exists(fileUri.AbsolutePath));
+            Assert.False(File.Exists(childDirUri.AbsolutePath));
+            Assert.False(File.Exists(directoryUri.AbsolutePath));
 
 Review comment:
   Asserting on the directory alone should suffice.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> DeleteDirectory of LocalFileSystem does not do recursive delete unlike other filesystem implementations
> -------------------------------------------------------------------------------------------------------
>
>                 Key: REEF-2037
>                 URL: https://issues.apache.org/jira/browse/REEF-2037
>             Project: REEF
>          Issue Type: Bug
>          Components: REEF
>            Reporter: Dwaipayan Mukhopadhyay
>            Assignee: Dwaipayan Mukhopadhyay
>            Priority: Major
>
> DeleteDirectory of LocalFileSystem does not do recursive delete unlike other filesystem implementations



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)