Frends.azure data lake.list files#18
Conversation
| public string ContainerName { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Name of the Azure Data Lake directory specifies the path where the data will be uploaded. |
| public string ClientSecret { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Name of the Azure Data Lake container where the data will be uploaded. |
| /// The type of the item (either "File" or "Directory"). | ||
| /// </summary> | ||
| /// <example>File</example> | ||
| public string Type { get; set; } |
There was a problem hiding this comment.
Lets mimic the same Azure thing, so would be just bool IsDirectory
|
|
||
| try | ||
| { | ||
| if (options.ListingStructure == ListingStructure.Flat) |
There was a problem hiding this comment.
Lets remove the options.ListingStructure altogether and simply replace it with a flag bool Recursive. This will simplify code and make it easier to understand for the user.
…ture for bool Recursive
| foreach (var isRecursive in recursiveOptions) | ||
| { | ||
| var options = new Options | ||
| { | ||
| DictionaryName = "Temp", | ||
| Recursive = isRecursive, | ||
| }; | ||
|
|
||
| var result = await AzureDataLake.ListFiles(source, options, default); | ||
|
|
||
| Assert.IsTrue(result.FileList.Any(x => x.Name == "Temp/SubFolderFile")); | ||
| Assert.IsTrue(result.FileList.Any(x => x.Name == "Temp/SubFolderFile2")); | ||
| Assert.IsTrue(result.FileList.Any(x => x.URL.Contains("/Temp/SubFolderFile"))); | ||
| Assert.IsTrue(result.FileList.Any(x => x.URL.Contains("/Temp/SubFolderFile2"))); | ||
|
|
||
| Assert.IsFalse(result.FileList.Any(x => x.Name == "TestFile.txt")); | ||
| Assert.IsFalse(result.FileList.Any(x => x.Name == "TestFile2.txt")); | ||
| } |
Check notice
Code scanning / CodeQL
Missed opportunity to use Select
| foreach (var isRecursive in recursiveOptions) | ||
| { | ||
| var options = new Options | ||
| { | ||
| DictionaryName = "Temp", | ||
| Recursive = isRecursive, | ||
| }; | ||
|
|
||
| var result = await AzureDataLake.ListFiles(source, options, default); | ||
|
|
||
| Assert.IsTrue(result.FileList.Any(x => x.Name == "Temp/SubFolderFile")); | ||
| Assert.IsTrue(result.FileList.Any(x => x.Name == "Temp/SubFolderFile2")); | ||
| Assert.IsTrue(result.FileList.Any(x => x.URL.Contains("/Temp/SubFolderFile"))); | ||
| Assert.IsTrue(result.FileList.Any(x => x.URL.Contains("/Temp/SubFolderFile2"))); | ||
|
|
||
| Assert.IsFalse(result.FileList.Any(x => x.Name == "TestFile.txt")); | ||
| Assert.IsFalse(result.FileList.Any(x => x.Name == "TestFile2.txt")); | ||
| } |
Check notice
Code scanning / CodeQL
Missed opportunity to use Select
| catch (Exception ex) | ||
| { | ||
| throw new ArgumentException("ListFileHandler error: ", ex); | ||
| } |
Check notice
Code scanning / CodeQL
Generic catch clause
|
CodeQL found vulnerabilities from the code. Check the PR or the workflow summary for the details: https://github.com/FrendsPlatform/Frends.AzureDataLake/actions/runs/9319381442?pr=18 |
|
CodeQL found vulnerabilities from the code. Check the PR or the workflow summary for the details: https://github.com/FrendsPlatform/Frends.AzureDataLake/actions/runs/9345458004?pr=18 |
Issue 10