cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the media folder full path

Former Member
0 Kudos

I am searching for a method that could returns the media folder full path like: C:/dev/work/myproject/hybris/data/media/sys_master/

I tried mediaService.getMedia but it returns only the path of the media inside sys_master Like testscriptfolder/h97/h0e/8797404266526.txt

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Richard,

basically String path = de.hybris.platform.util.Config.getParameter("media.read.dir"); should get you the media folder.

Best regards
Dirk

Answers (4)

Answers (4)

Former Member
0 Kudos

Sys_master is the tenantId. You can use tenantService.getCurrentTenantId to get the tenant injected dynamically. Hope that helps!

Former Member
0 Kudos

Thank u Dirk

Former Member
0 Kudos

Hi Dirk,

I want the complete path to the media folder. I am getting the path upto media folder and then followed by what is inside of sys_master. I want to include this sys_master in the path ? Without hard coding. Is there any in built method or configuration?

Thanks,

Former Member
0 Kudos

Please have a look at the documentation of MediaFolders:

https://wiki.hybris.com/display/release5/MediaFolders

[...]"The MediaFolders of the hybris Commerce Suite installation are tenant-specific, so that every individual tenant will have individual media folders. For every individual tenant, an individual directory named sys_ ${tenant} is created in the deployment directory of the application server. For example, you may have the following MediaFolders: cronjob, hmc and impex, and the following tenants: master and junit."[...]

Former Member
0 Kudos

Thank you Dirk, It worked, what about sys_master and sys_junit folders?