Gets the server configuration under a given $FEDORA_HOME/server/ directory.
@param serverHome the server directory
@return the server configuration.
508022
public static ServerConfiguration getConfig(File serverHome) {
        try {
            InputStream fcfg = new FileInputStream(
                    new File(serverHome,
                             "config/fedora.fcfg"));
            ServerConfigurationParser parser =
                new ServerConfigurationParser(fcfg);
            return parser.parse();
        } catch (IOException e) {
            throw new FaultException("Error loading server configuration",
                                     e);
        }
    }
658426
protected static function getUserHomeDir() {
        // Cannot use $_SERVER superglobal since that's empty during UnitUnishTestCase
        // getenv('HOME') isn't set on Windows and generates a Notice.
        $home = getenv('HOME');

        if (!empty($home)) {
            // home should never end with a trailing slash.
            $home = rtrim($home, '/');
        } elseif (!empty($_SERVER['HOMEDRIVE']) && !empty($_SERVER['HOMEPATH'])) {
            // home on windows
            $home = $_SERVER['HOMEDRIVE'] . $_SERVER['HOMEPATH'];
            // If HOMEPATH is a root directory the path can end with a slash. Make sure
            // that doesn't happen.
            $home = rtrim($home, '\\/');
        }

        return empty($home) ? NULL : $home;
    }
982655
private function getRemoteUser($serverKey) {
    if (!isset($this->users[$serverKey])) {
      $config = ObjectFactory::getInstance('configuration');
      $remoteUser = $config->getValue($serverKey, 'remoteuser');
      if (is_array($remoteUser) && sizeof($remoteUser) == 2) {
        $this->users[$serverKey] = [
          'login' => $remoteUser[0],
          'password' => $remoteUser[1]
        ];
      }
      else {
        throw new IllegialConfigurationException(
                "Remote user definition of '".$serverKey.
                "' must be an array of login and password."
        );
      }
    }
    return $this->users[$serverKey];
  }
385104
public static ServerConfiguration loadConfiguration() {
        final ServerConfiguration configuration = createConfiguration();
        Assert.requireNonNull(configuration, "configuration");

        final ServiceLoader<ConfigurationProvider> serviceLoader = ServiceLoader.load(ConfigurationProvider.class);
        for(final ConfigurationProvider provider : serviceLoader) {
            final Map<String, String> additionalStringProperties = provider.getStringProperties();
            for(final Map.Entry<String, String> property : additionalStringProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setProperty(property.getKey(), property.getValue());
                }
            }
            final Map<String, List<String>> additionalListProperties = provider.getListProperties();
            for(final Map.Entry<String, List<String>> property : additionalListProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setListProperty(property.getKey(), property.getValue());
                }
            }
            final Map<String, Boolean> additionalBooleanProperties = provider.getBooleanProperties();
            for(final Map.Entry<String, Boolean> property : additionalBooleanProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setBooleanProperty(property.getKey(), property.getValue());
                }
            }
            final Map<String, Integer> additionalIntegerProperties = provider.getIntegerProperties();
            for(final Map.Entry<String, Integer> property : additionalIntegerProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setIntProperty(property.getKey(), property.getValue());
                }
            }
            final Map<String, Long> additionalLongProperties = provider.getLongProperties();
            for(final Map.Entry<String, Long> property : additionalLongProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setLongProperty(property.getKey(), property.getValue());
                }
            }
        }
        LOG.debug("Configuration created with {} properties", configuration.getPropertyKeys().size());
        if(LOG.isTraceEnabled()) {
            for(final String key : configuration.getPropertyKeys()) {
                LOG.debug("Dolphin Platform configured with '{}'='{}'", key, configuration.getProperty(key, null));
            }
        }

        return configuration;
    }
187918
public function getServer($name = null, $defaultValue = null)
    {
        if ($name === null) {
            return $_SERVER;
        }
        
        $value = (isset($_SERVER[$name])) ? $_SERVER[$name] : $defaultValue;
        return $value;
    }
367432
@Override
  public String getHomeDirectory() {
    try {
      FileSystem fs = FileSystem.get(CONF);
      return fs.getHomeDirectory().toString();
    }
    catch (Exception e) {
      return null;
    }
  }
941896
public File getHomeDirectory() {
        if (!configuration.has(STORAGE_DIRECTORY))
            throw new UnsupportedOperationException("No home directory specified");
        File dir = new File(configuration.get(STORAGE_DIRECTORY));
        Preconditions.checkArgument(dir.isDirectory(), "Not a directory");
        return dir;
    }
333596
public function getServer()
    {
        if ($this->server === null) {
            if (isset($_SERVER['argv'])) {
                $this->server = $_SERVER['argv'];
                array_shift($this->server);
            } else {
                $this->server = [];
            }
        }

        return $this->server;
    }
1161854
public org.apache.hadoop.conf.Configuration getOrLoadHadoopConfig() {
		org.apache.hadoop.conf.Configuration hadoopConfig = this.hadoopConfig;
		if (hadoopConfig == null) {
			if (flinkConfig != null) {
				hadoopConfig = mirrorCertainHadoopConfig(loadHadoopConfigFromFlink());
			}
			else {
				LOG.warn("Flink configuration is not set prior to loading this configuration."
					+ " Cannot forward configuration keys from Flink configuration.");
				hadoopConfig = new org.apache.hadoop.conf.Configuration();
			}
		}
		this.hadoopConfig = hadoopConfig;
		return hadoopConfig;
	}
437273
protected Server getReadServer() {
        Server[] servers = readServers;

        return servers[readSequence.incrementAndGet(servers.length)];
    }
1062875
public function getConfigurationFile( $serverName, $login){
        $service = sprintf( self::API_VPN_USER_CONFIG, $serverName, $login);
        $rest = $this->getService( $service);
        $rest->getConfig()->setIsReturnToJsonDecode( false);
        $rest->setIsResponseToCheck( false);
        $rest->GET();

        return $rest->getCurlResponse();
    }
849125
public ProviderConfig<T> setServer(ServerConfig server) {
        if (this.server == null) {
            this.server = new ArrayList<ServerConfig>();
        }
        this.server.add(server);
        return this;
    }
427470
@Override
    public void init() throws ServletException {

        String fedoraHome = Constants.FEDORA_HOME;

        if (fedoraHome == null || fedoraHome.length() == 0) {
            throw new ServletException("FEDORA_HOME is not defined");
        } else {
            _serverDir = new File(new File(fedoraHome), "server");
            if (!_serverDir.isDirectory()) {
                throw new ServletException("No such directory: "
                        + _serverDir.getPath());
            }
        }

    }
786651
public synchronized static Server getServer(ServerConfig serverConfig) {
        try {
            Server server = SERVER_MAP.get(Integer.toString(serverConfig.getPort()));
            if (server == null) {
                // 算下网卡和端口
                resolveServerConfig(serverConfig);

                ExtensionClass<Server> ext = ExtensionLoaderFactory.getExtensionLoader(Server.class)
                    .getExtensionClass(serverConfig.getProtocol());
                if (ext == null) {
                    throw ExceptionUtils.buildRuntime("server.protocol", serverConfig.getProtocol(),
                        "Unsupported protocol of server!");
                }
                server = ext.getExtInstance();
                server.init(serverConfig);
                SERVER_MAP.put(serverConfig.getPort() + "", server);
            }
            return server;
        } catch (SofaRpcRuntimeException e) {
            throw e;
        } catch (Throwable e) {
            throw new SofaRpcRuntimeException(e.getMessage(), e);
        }
    }
411377
public function getServer($key = null, $default = null) {
        if (null === $key) {
            return $this->SERVER;
        }

        return (isset($this->SERVER[$key])) ? $this->SERVER[$key] : $default;
    }
436592
public function get($serverName)
    {
        if (!isset($this->servers[$serverName])) {
            throw NoSuchServerException::forServerName($serverName);
        }

        return $this->servers[$serverName];
    }
1308686
public static function determineHostModel(): string
    {
        $hostModel = config('server-monitor.host_model') ?? Host::class;

        if (! is_a($hostModel, Host::class, true)) {
            throw InvalidConfiguration::hostModelIsNotValid($hostModel);
        }

        return $hostModel;
    }