YamlFileResource requires an existing File
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Read Utils.createFileIfNotExists and its use in SettingsManagerBuilder, then inspect YamlFileResource#createReader and YamlFileReader#loadFile. Refactor the utility as described and use it when creating the reader so a missing configuration file no longer causes NoSuchFileException.
Written by the indexing model from the issue text.
Description
YamlFileResource#createReader calls YamlFileReader#loadFile which uses Files.newInputStream(path: Path) which will throw a NoSuchFileException if the File at that path does not exist.
SettingsManagerBuilder uses the Utils method Utils.createFileIfNotExists(path: Path) to avoid this scenario:
https://github.com/AuthMe/ConfigMe/blob/5f8aa2a4007348efaefbc9a41b740ffb6788bf25/src/main/java/ch/jalu/configme/SettingsManagerBuilder.java#L58
Refactoring this method to return the path, and using it inline here:
https://github.com/AuthMe/ConfigMe/blob/5f8aa2a4007348efaefbc9a41b740ffb6788bf25/src/main/java/ch/jalu/configme/resource/YamlFileResource.java#L53
Would probably be the best route for ensuring proper functionality of YamlFileResource as a whole.
- Dominant language
- Java
- Stars
- 44
- Forks
- 21
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AuthMe/ConfigMe
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
architecture
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100