micronaut-projects/micronaut-core

Add method to ResourceResolver to retrieve a directory

オープン

#1,000 opened on 2018/12/04

 (8 件のコメント) (1 件のリアクション) (0 人の担当者)Java (1,025 件のフォーク)batch import
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

  1. Create a file somefile.txt in src/main/resources/somedir.
  2. Inject the ResourceResolver.
  3. Call resourceResolver.getResource("classpath:somedir/")--> this returns Optional.empty but 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)

コントリビューターガイド