Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.litesoft.initfrom.server;

import org.litesoft.configuration.*;

import java.util.*;

public class InitFrom_Configuration {
    private static final String SYSTEM_PROP_CONFIG_FILE = "CONFIG_FILE";

    private static String makeConfigFileName() {
        String zProperty = System.getProperty( SYSTEM_PROP_CONFIG_FILE );
        return (zProperty != null) ? zProperty : "InitFrom.properties";
    }

    // Set up the Search Path
    private static List<String> createConfigSearchPath( String... pAdditionalPaths ) {
        List<String> zSearchPath = new ArrayList<String>();

        zSearchPath.add( System.getProperty( "CONFIG_DIR" ) );
        if ( pAdditionalPaths != null ) {
            for ( String zAdditionalPath : pAdditionalPaths ) {
                if ( zAdditionalPath != null ) {
                    zSearchPath.add( zAdditionalPath );
                }
            }
        }
        zSearchPath.add( System.getenv( "CONFIG_DIR" ) );

        return zSearchPath;
    }

    public static synchronized void initialize( String... pAdditionalPaths ) {
        if ( !Configuration.isInstantiated() ) {
            new ServerConfiguration( makeConfigAccessorLocator( pAdditionalPaths ) ); // force creation & self registration

            // LoggerFactory.init( new ConfigurationLoggerLevel(), getLoggerProxy() );
        }
    }

    private static ConfigAccessorLocator makeConfigAccessorLocator( String... pAdditionalPaths ) {
        String configFileName = makeConfigFileName();
        List<String> zSearchPath = createConfigSearchPath( pAdditionalPaths );

        return new ConfigAccessorLocator( configFileName, ConfigAccessorFactoryProperties.INSTANCE, zSearchPath );
    }
}

Commits for litesoft/trunk/GWT_Sandbox/InitFrom/src/org/litesoft/initfrom/server/InitFrom_Configuration.java

Diff revisions: vs.
Revision Author Commited Message
950 Diff Diff GeorgeS picture GeorgeS Thu 19 Jun, 2014 17:57:04 +0000

New Lines

948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

459 GeorgeS picture GeorgeS Sun 21 Aug, 2011 00:42:41 +0000