Results 1 to 6 of 6

Thread: How to resolve ${com.wowza.wms.ConfigHome} from properties?

  1. #1

    Default How to resolve ${com.wowza.wms.ConfigHome} from properties?

    Hi!

    If I've to use a .properties file and I'd like to have it in my apps. conf folder, how may I get hold of the file path of the file to read it with the Properties class' load method?

    How can I've something like this in my application configuration?

    <Properties>
    <Property>
    <Name>ConfigDir</Name>
    <Value>${com.wowza.wms.ConfigHome}\settings.proper ties</Value>
    </Property>
    </Properties>

    Thanks,
    Attila
    Last edited by attilah; 04-02-2010 at 06:51 AM.

  2. #2
    Join Date
    Dec 2007
    Posts
    25,630

    Default

    The Properties class is a Java class you can use in your Module directly.
    http://java.sun.com/j2se/1.4.2/docs/...roperties.html

    If you want to use Application.xml /Properties, you can use Wowza WMSProperties.

    Code:
    <Property>
    <Name>someProperty</Name>
    <Value>someValue</Value>
    </Property>
    Code:
    public void onAppStart(IApplicationInstance appInstance) {
    	String someValue = appInstance.getProperties().getPropertyStr("someValue");
    }

  3. #3

    Default

    Let me rephrase my question:

    I WANT to use the Properties class, not WMSProperties.

    // This type comes from Spring
    FileSystemResource f = new FileSystemResource ("my.properties");

    Properties p = new Properties ();

    // This will throw a FileNotFoundException
    p.load (f.getInputStream ());

    Question 1:

    How can I resolve Wowza "environment" folders, like the conf\MyApplication folder? Which makes me able to instantiate a FileSystemResource like this:

    FileSystemResource f = new FileSystemResource (getSomehowTheConfFolder () + "\my.properties");

    Question 2:
    You are supporting the expansion of ${com.wowza.wms.ConfigHome} to the real folder in StreamFolder settings section of Application.xml.

    What function can I use to achieve the same and have a setting like this in my Application.xml:

    <Properties>
    <Property>
    <Name>ConfigDir</Name>
    <Value>${com.wowza.wms.ConfigHome}\settings.prop er ties</Value>
    <Type>Filename</Type>
    </Property>
    </Properties>

    The Type=Filename should trigger your own mechanism of expanding variables inside that property value...

    Thanks,
    Attila

  4. #4

    Default Solved

    Maybe the environment manipulation functions should be more documented, since there is a very good way to achieve what I like.

    String appHome = Bootstrap.getServerHome (Bootstrap.APPHOME);
    StringBuilder sb = new StringBuilder();

    String configPath = sb
    .append(appHome)
    .append(File.separatorChar)
    .append("conf")
    .append(File.separatorChar)
    .append (appInstance.getApplication ().getName ())
    .append (File.separatorChar).append("my.properties").toStr ing();

    This is producing for me:

    C:/Program Files/Wowza Media Systems/Wowza Media Server 2/conf/testapp/my.properties what I can use to open the file and do what I want.

    also I've found useful the Bootstrap.getServerHome (Bootstrap.CONFIGHOME) call.

    Can you provide a full reference of the settings you are storing within the System object properties, com.wowza.wms.* ? This can be very useful!

    Expand environment variables can be done also this way.

    Thanks,
    Attila

  5. #5
    Join Date
    Dec 2007
    Posts
    25,630

    Default

    Great! Glad it's solved:

    From Application.xml

    ${com.wowza.wms.AppHome} - Application home directory
    ${com.wowza.wms.ConfigHome} - Configuration home directory
    ${com.wowza.wms.context.VHost} - Virtual host name
    ${com.wowza.wms.context.VHostConfigHome} - Virtual host config directory
    ${com.wowza.wms.context.Application} - Application name
    ${com.wowza.wms.context.ApplicationInstance} - Application instance name
    Also there is configuration reference, [wowza-install-dir]/documentation/WowzaMediaServer_ConfigurationReference.pdf

    Richard

  6. #6

    Default

    Cool, I'll check out that document too :-)

    In another thread you mentioned a PPM system you've...I'd like to get to the point and see how can I leverage the billing data needed from the media stream action interface events...

    Thanks again Richard :-)

    - Attila

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •