micronaut-projects/micronaut-core
Add method to ResourceResolver to retrieve a directory
オープン
#1,000 opened on 2018/12/04
help wantedinfo: good first issuepriority: lowtype: improvement
Repository metrics
- Stars
- (5,882 個のスター)
- PR merge metrics
- (平均マージ 18d 12h) (30d で 60 merged PRs)
説明
Task List
- Steps to reproduce provided
- Stacktrace (if present) provided
- Example that reproduces the problem uploaded to Github
- Full description of the issue provided (see below)
Steps to Reproduce
- Create a file
somefile.txtinsrc/main/resources/somedir. - Inject the
ResourceResolver. - Call
resourceResolver.getResource("classpath:somedir/")--> this returnsOptional.emptybut reference to directory expected.
Note that getting the somefile.txt resource directly via resourceResolver.getResource("classpath:somedir/somefile.txt") dies return the resource.
My current alternative is val dir = MyClass::class.java.getResource("/somedir/").
Expected Behaviour
ResourceResolver.getResource should return URI pointing to directory.
Actual Behaviour
Optional.empty returned.
Environment Information
- Operating System: OSX
- Micronaut Version: 1.0.1
- JDK Version: JDK8 (Kotlin)