Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StorageFileHelper - Add GetFilesInDirectoryAsync #16341

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rafael-rosa-knowcode
Copy link
Contributor

GitHub Issue (If applicable): closes #

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

The StorageFileHelper just have one method for Determines if an asset or resource exists within application package.
But could be a nice feature to retrieves the paths of files within a directory.

What is the new behavior?

So this PR is for allow to retrieves the paths of files within a directory based on a specified filter for file extensions (If null, all files in the directory are considered.)
And the result is an array of strings containing the paths of the filtered files within the directory.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@github-actions github-actions bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform labels Apr 17, 2024
@rafael-rosa-knowcode
Copy link
Contributor Author

@nickrandolph Can you confirm if you agree with the code?
@jeromelaban Can you take a look and comment or direct someone?

@unodevops
Copy link
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-16341/index.html

@unodevops
Copy link
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-16341/index.html

@nickrandolph
Copy link
Contributor

@jeromelaban one of the questions we had here is whether we can make StorageFileHelper public. We need to access it, so we can either make it public or internal, with internals access granted to the appropriate library. Thoughts?

/// </summary>
/// <param name="extensionsFilter">An array of strings representing the file extensions to filter the files.If null, all files in the directory are considered.</param>
/// <returns>An array of strings containing the paths of the filtered files within the directory.</returns>
public static async Task<string[]> GetFilesInDirectoryAsync(string[] extensionsFilter)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Folder instead of Directory to preserve WinUI convention

@MartinZikmund
Copy link
Member

@jeromelaban one of the questions we had here is whether we can make StorageFileHelper public. We need to access it, so we can either make it public or internal, with internals access granted to the appropriate library. Thoughts?

I think public is preferable even if it is not intended for usage by users, as we can then more easily avoid making unintended breaking changes when we were to adjust naming some other first-party library depends on for example

@jeromelaban
Copy link
Member

@jeromelaban one of the questions we had here is whether we can make StorageFileHelper public. We need to access it, so we can either make it public or internal, with internals access granted to the appropriate library. Thoughts?

What do you need from storage helper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants