how to get test resources test.png systematically...
# getting-started
c
how to get test resources test.png systematically from Peer ?
Copy code
.
├── kotlin
│   └── io
│       └── github
│           └── freewebmovement
│               └── peer
│                   ├── Peer.kt
│                   └── Time.kt
└── resources
    ├── release.apk
    └── test.png
this code is not working.
Copy code
val url = javaClass.getResource("test.png")
s
A class looks for resources in its own package. If you want resources from the root directory, you need
ClassLoader.getSystemResource
instead.
👍 1
j
You can also use a leading
/
in the resource path if I recall correctly
☝️ 1