Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with default path

Okay guys, I made one research and I found nothing to exemplify correctly that I did this and to not post this as someone lazy. My problem is:

I have one image on the rsc folder of my project. I can acess it from a full path name:

C:\Users\Victor\workspace\SHST\rsc\image.jpg

But, I need to move this folder in future to another desktop and 'course I can't change for every variable the Main path "C:\Users\Victor\workspace\". I tried to thing about environment variables but even though I swear I found nothing. I know there is a way to do this and it's not so hard as it's seems, that's why I can't realize I found nothing about it. Could anyone help me please?

like image 545
Victor R. Oliveira Avatar asked Dec 06 '25 06:12

Victor R. Oliveira


1 Answers

Put the image into C:\Users\Victor\workspace\SHST\res\ folder in your project and load the image file by call res/image.jpg. Than, anywhere you'll replace your project, it should being loaded.

like image 79
SeniorJD Avatar answered Dec 08 '25 20:12

SeniorJD