public static String discoverLocation(final String options) {

		/** Priority 1) user provided agent command line options. */
		if (options != null) {
			final String[] optionArray = options.split(",");
			for (final String option : optionArray) {
				if (option.startsWith(SYSTEM_PROPERTY) && option.contains("=")) {
					logger.info("Using location provided by options.");
					return option.substring(option.indexOf("=") + 1);
				}
			}
		}

		/** Priority 2) user provided o/s environment variable. */
		final String variable = System.getenv(ENVIRONMENT_VARIABLE);
		if (variable != null) {
			logger.info("Using location provided by environment variable.");
			return variable;
		}

		/** Priority 3) user provided java system property. */
		final String property = System.getProperty(SYSTEM_PROPERTY);
		if (property != null) {
			logger.info("Using location provided by system property.");
			return property;
		}

		/** Priority 4) hard coded location. */
		logger.info("Using location provided by hard coded value.");
		return DEFAULT_LOCATION;

	}
public static String discoverLocation ( final String options ) { if ( options != null ) { final String [ ] optionArray = options . split ( "," ) ; for ( final String option : optionArray ) { if ( option . startsWith ( SYSTEM_PROPERTY ) && option . contains ( "=" ) ) { logger . info ( "Using location provided by options." ) ; return option . substring ( option . indexOf ( "=" ) + 1 ) ; } } } final String variable = System . getenv ( ENVIRONMENT_VARIABLE ) ; if ( variable != null ) { logger . info ( "Using location provided by environment variable." ) ; return variable ; } final String property = System . getProperty ( SYSTEM_PROPERTY ) ; if ( property != null ) { logger . info ( "Using location provided by system property." ) ; return property ; } logger . info ( "Using location provided by hard coded value." ) ; return DEFAULT_LOCATION ; }
Discover sigar library extract location. <br>
Priority 1) user provided command line agent options. <br>
Priority 2) user provided o/s environment variable. <br>
Priority 3) user provided java system property. <br>
Priority 4) hard coded location in ${user.dir}/native. <br>

@param options
Command line agent options.
@return Discovered sigar library extract location.