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

SimpleKeyFile.getKeys() seems to load the key file for every key. #563

Open
alcarraz opened this issue Sep 30, 2023 · 0 comments
Open

SimpleKeyFile.getKeys() seems to load the key file for every key. #563

alcarraz opened this issue Sep 30, 2023 · 0 comments

Comments

@alcarraz
Copy link
Contributor

alcarraz commented Sep 30, 2023

Doesn’t this load the file for every key?

keys.put(alias, getKey(alias));

Perhaps we could call load() at the beginning of the getKeys() method, and add an overload of getkey() that receives a boolean telling if it has to perform the load(), then in getKey(String) call it with true, and in getKeys() call it with false.

Other possible enhancements could be to add configuration properties for:

  1. loading only if the file timestamp changed.
  2. setting load frequency, i.e., don't check if elapsed time is less than some given period, in this case we would have two options for setKey():
  3. Add a readonly property, and throw an exception if called.
  4. When calling load, pass a parameter to force the file loading.

I'm willing to implement decided options in a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant