I'm having a class MailSend
which needs to get .png
resource, but I can't read it, tried using classloader but it goes to another directory from jar. The closes directory I get from using MailSend.class.getResource("")
but the resource is two folders up I tried using ../..
but if gives me exception is there an alternative to go up or I need to use something else?
Asked
Active
Viewed 34 times
0

Jonis Depas
- 1
- 1
-
Is the png you are looking for in a parent or child folder? – Murillio4 Oct 04 '16 at 08:05
-
MailSend class is in Test/services/mail/MailSend and resource is in Test/resources/images/logo.png – Jonis Depas Oct 04 '16 at 08:09
-
Can this be to any help? http://stackoverflow.com/questions/16770384/parent-parent-directory-in-java – Murillio4 Oct 04 '16 at 08:17
-
Yeah i found the answer in one of comments. Thank you :) – Jonis Depas Oct 04 '16 at 08:24