# Understand expandEnvironmentVariables(String, java.util.Map)

**URL:** <https://community.wowza.com/t/understand-expandenvironmentvariables-string-java-util-map/40628>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [August 14, 2013, 9:04pm UTC](https://community.wowza.com/t/understand-expandenvironmentvariables-string-java-util-map/40628 "2013-08-14T21:04:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yehudi\_cheng](https://avatars.discourse-cdn.com/v4/letter/y/9dc877/32.png) [@yehudi\_cheng](https://community.wowza.com/u/yehudi_cheng)\
**Post date:** [August 14, 2013, 9:04pm UTC](https://community.wowza.com/t/understand-expandenvironmentvariables-string-java-util-map/40628/1 "2013-08-14T21:04:57Z")

</div>

Hi,

I readed the [document](https://www.wowza.com/docs/how-to-do-file-based-rtmp-authentication-with-url-query-strings-onconnectauthenticate2&page=2) but still not well understand about the com.wowza.util.SystemUtilsexpandEnvironmentVariables(String, java.util.Map)

ex:

```auto
                        envMap.put("com.wowza.wms.context.VHost", vhost.getName());
			envMap.put("com.wowza.wms.context.VHostConfigHome", vhost.getHomePath());
			envMap.put("com.wowza.wms.context.Application", appInstance.getApplication().getName());
			envMap.put("com.wowza.wms.context.ApplicationInstance", appInstance.getName());
			passwordFileStr = SystemUtils.expandEnvironmentVariables(passwordFileStr, envMap);

```

passwordFileStr seems never be changed, not sure how would happen on the environment variables. Can someone help to explain that? thank you.

Yehudi

---

<div class="post-metadata">

**Author:** ![yehudi\_cheng](https://avatars.discourse-cdn.com/v4/letter/y/9dc877/32.png) [@yehudi\_cheng](https://community.wowza.com/u/yehudi_cheng)\
**Post date:** [August 15, 2013, 8:43am UTC](https://community.wowza.com/t/understand-expandenvironmentvariables-string-java-util-map/40628/2 "2013-08-15T08:43:06Z")

</div>

Answer by myself, the envMap content would be used in the decode result of expandEnvironmentVariables(passwordFileStr, envMap),

the reason to use expandEnvironmentVariables(String, java.util.Map) rather than the expandEnvironmentVariables(String) maybe the same as the

[post](https://www.wowza.com/forums/showthread.php?5049-decoding-storage-path-variables-in-server-properties&p=48929#post48929) : some environment variables can NOT be decoded so programmer have to assign them first.

Yehudi
