Configures defaults for connections opened with {@link #upload(String)}, {@link
#attribution(String)} and {@link #projectSettings(String)}.
348078
protected HttpURLConnection openConnection(String url) throws IOException {
    HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
    connection.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT_MILLIS);
    connection.setReadTimeout(DEFAULT_READ_TIMEOUT_MILLIS);
    connection.setRequestProperty("Content-Type", "application/json");
    connection.setRequestProperty("User-Agent", USER_AGENT);
    connection.setDoInput(true);
    return connection;
  }
959978
public function setDefaultsFromConfiguration()
    {
        if ($this->options['dsn']) {
            $dsn = explode(':', $this->options['dsn']);
            $this->setSQLDialect($dsn[0]);
        }

        $this->setTablePrefix($this->options['table_prefix']);
    }
234025
private function setDefaultConfig()
    {
        $defaults = $this->configRepo->get('laravelPnotify');

        foreach($defaults as $key => $value){
            $this->config[$key] = $value;
        }
    }
535094
private void initWebClientConfig() {
        m_webClientConfig = new WebClientConfiguration();

        if (getParameter("httpClientTimeoutSecs") != null)
            m_webClientConfig.setTimeoutSecs(Integer.parseInt(getParameter("httpClientTimeoutSecs")));

        if (getParameter("httpClientSocketTimeoutSecs") != null)
            m_webClientConfig.setSockTimeoutSecs(Integer.parseInt(getParameter("httpClientSocketTimeoutSecs")));

        if (getParameter("httpClientMaxConnectionsPerHost") != null)
            m_webClientConfig.setMaxConnPerHost(Integer.parseInt(getParameter("httpClientMaxConnectionsPerHost")));

        if (getParameter("httpClientMaxTotalConnections") != null)
            m_webClientConfig.setMaxTotalConn(Integer.parseInt(getParameter("httpClientMaxTotalConnections")));

        if (getParameter("httpClientFollowRedirects") != null)
            m_webClientConfig.setFollowRedirects(Boolean.parseBoolean(getParameter("httpClientFollowRedirects")));

        if (getParameter("httpClientMaxFollowRedirects") != null)
            m_webClientConfig.setMaxRedirects(Integer.parseInt(getParameter("httpClientMaxFollowRedirects")));

        if (getParameter("httpClientUserAgent") != null)
            m_webClientConfig.setUserAgent(getParameter("httpClientUserAgent"));
    }
966883
protected void setDefaultsForEmptyResourceFields() throws CmsImportExportException {

        // get UUID for the structure
        if (m_resourceBuilder.getStructureId() == null) {
            // if null generate a new structure id
            m_resourceBuilder.setStructureId(new CmsUUID());
        }

        // get UUIDs for the resource
        if ((m_resourceBuilder.getResourceId() == null) || (m_resourceBuilder.getType().isFolder())) {
            // folders get always a new resource UUID
            m_resourceBuilder.setResourceId(new CmsUUID());
            m_resourceIdWasNull = true;
        }

        // read date last modified from the resource, default to currentTime for folders
        if (m_resourceBuilder.getDateLastModified() == DATE_LAST_MODIFICATION_FILETIME) {
            if (null != m_source) {
                m_resourceBuilder.setDateLastModified(m_helper.getFileModification(m_source));
            } else {
                m_resourceBuilder.setDateLastModified(System.currentTimeMillis());
            }
        }

        if (m_resourceBuilder.getDateLastModified() == DATE_LAST_MODIFICATION_UNSPECIFIED) {
            m_resourceBuilder.setDateLastModified(System.currentTimeMillis());
        }

        if (null == m_resourceBuilder.getUserLastModified()) {
            m_resourceBuilder.setUserLastModified(m_cms.getRequestContext().getCurrentUser().getId());
        }

        if (m_resourceBuilder.getDateCreated() == DATE_CREATED_UNSPECIFIED) {
            m_resourceBuilder.setDateCreated(System.currentTimeMillis());
        }

        if (m_resourceBuilder.getUserCreated().isNullUUID()) {
            m_resourceBuilder.setUserCreated(getRequestContext().getCurrentUser().getId());
        }

        if (m_properties == null) {
            m_properties = new HashMap<String, CmsProperty>();
        }
    }
756667
public static void setToDefault ()
  {
    s_aRWLock.writeLocked ( () -> {
      s_nMaxMailQueueLen = DEFAULT_MAX_QUEUE_LENGTH;
      s_nMaxMailSendCount = DEFAULT_MAX_SEND_COUNT;
      s_bUseSSL = DEFAULT_USE_SSL;
      s_bUseSTARTTLS = DEFAULT_USE_STARTTLS;
      s_nConnectionTimeoutMilliSecs = DEFAULT_CONNECT_TIMEOUT_MILLISECS;
      s_nTimeoutMilliSecs = DEFAULT_TIMEOUT_MILLISECS;
      s_bDebugSMTP = GlobalDebug.isDebugMode ();
      s_aConnectionListeners.clear ();
      s_aEmailDataTransportListeners.clear ();
    });
  }
229714
def __init_defaults(self, config):
        """"""

        provider = self.__provider

        if provider == 'sqlite':
            config.setdefault('dbname', ':memory:')
            config.setdefault('create_db',  True)
        elif provider == 'mysql':
            config.setdefault('port', 3306)
            config.setdefault('charset', 'utf8')
        elif provider == 'postgres':
            config.setdefault('port', 5432)
        elif provider == 'oracle':
            config.setdefault('port', 1521)
        else:
            raise ValueError('Unsupported provider "{}"'.format(provider))

        if provider != 'sqlite':
            config.setdefault('host', 'localhost')
            config.setdefault('user', None)
            config.setdefault('password', None)
            config.setdefault('dbname', None)
395112
private static function setDefaultConfig() {
            if (!self::$defaults) {
                self::$defaults = [self::CFG_ERROR_LEVEL        => error_reporting(),
                                   self::CFG_LOG_ERROR_LOCATION => true];
            }
        }
49930
static void initDefaultHandlers() {
		if (config != null && config.getDefaultHandlers() != null) {
			defaultHandlers = getHandlersFromExecList(config.getDefaultHandlers());
			handlerListById.put("defaultHandlers", defaultHandlers);
		}
	}
380701
@SuppressWarnings("checkstyle:regexp")
	public static void showDefaults() {
		final Properties defaultValues = new Properties();
		JanusConfig.getDefaultValues(defaultValues);
		NetworkConfig.getDefaultValues(defaultValues);
		try (OutputStream os = getConsoleLogger()) {
			defaultValues.storeToXML(os, null);
			os.flush();
		} catch (Throwable e) {
			e.printStackTrace();
		}
		getExiter().exit();
	}
605832
private function setSettings() {
		$this->template->uploadUrl = $this->controller->link("upload");
		$this->template->renameLink = $this->controller->link("rename");
		$this->template->removeLink = $this->controller->link("//remove");
		$this->template->inputId = $this->renderer->getElements()["input"]->attrs["id"];
		
		$this->needTranslate();
		$this->template->messages = $this->controller->getUploadControl()->getMessages();
		
		/** @noinspection PhpInternalEntityUsedInspection */
		$this->template->maxFiles = $this->controller->getUploadControl()->getMaxFiles();
		/** @noinspection PhpInternalEntityUsedInspection */
		$this->template->maxFileSize = $this->controller->getUploadControl()->getMaxFileSize();
		/** @noinspection PhpInternalEntityUsedInspection */
		$this->template->fileSizeString = $this->controller->getUploadControl()->getFileSizeString();
		$this->template->productionMode = Debugger::$productionMode;
		/** @noinspection PhpInternalEntityUsedInspection */
		$this->template->token = $this->controller->getUploadControl()->getToken();
		$this->template->params = json_encode($this->controller->getUploadControl()->getParams());
		$this->template->settings = $this->controller->getUploadControl()->getUploadSettings();
		
		$default = $this->controller->getUploadControl()->getDefaultFiles();
		
		$defaultFiles = [];
		foreach($default as $file) {
			$defaultFiles[] = $file->toArray();
		}
		
		$this->template->defaultFiles = $defaultFiles;
	}
133919
public static void setDefaultUri(Configuration conf, URI uri) {
    conf.set(FS_DEFAULT_NAME_KEY, uri.toString());
  }
860572
private void setupTaskDefaults(Project project, CpdExtension extension) {
        project.getTasks().withType(Cpd.class).configureEach(task -> {
            ConventionMapping taskMapping = task.getConventionMapping();
            taskMapping.map("encoding", extension::getEncoding);
            taskMapping.map("ignoreAnnotations", extension::isIgnoreAnnotations);
            taskMapping.map("ignoreIdentifiers", extension::isIgnoreIdentifiers);
            taskMapping.map("ignoreFailures", extension::isIgnoreFailures);
            taskMapping.map("ignoreLiterals", extension::isIgnoreLiterals);
            taskMapping.map("language", extension::getLanguage);
            taskMapping.map("minimumTokenCount", extension::getMinimumTokenCount);
            taskMapping.map("pmdClasspath", () -> project.getConfigurations().findByName("cpd"));
            taskMapping.map("skipDuplicateFiles", extension::isSkipDuplicateFiles);
            taskMapping.map("skipLexicalErrors", extension::isSkipLexicalErrors);
            taskMapping.map("skipBlocks", extension::isSkipBlocks);
            taskMapping.map("skipBlocksPattern", extension::getSkipBlocksPattern);

            ConventionMapping extensionMapping = ((IConventionAware) extension).getConventionMapping();
            extensionMapping.map("reportsDir", () -> project.getExtensions().getByType(ReportingExtension.class).file("cpd"));

            task.getReports().all(report -> {
                ConventionMapping reportMapping = ((IConventionAware) report).getConventionMapping();
                reportMapping.map("enabled", () -> "xml".equals(report.getName()));
                reportMapping.map("destination", () -> new File(extension.getReportsDir(), task.getName() + "." + report.getName()));
            });
        });
    }
95685
def _setDefaults(self):
        

        for configName, configDict in self.configs.items():
            self._setConfig(configName, configDict['default'])
995598
private void setDefaults() {
        if (xsdInput == null) {
            setXsdInput(DEFAULT_INPUT_FOLDER_PATH);
        }
        if (output == null) {
            setOutput(DEFAULT_OUTPUT_FOLDER_PATH);
        }
        if (avroNamespacePrefix == null) {
            setAvroNamespacePrefix(DEFAULT_AVRO_NAMESPACE_PREFIX);
        }

    }
405399
@Override
    public void setDefaultGraphPerms(GraphPermissions graphPerms) {
        if(notNull(graphPerms)) {
            this.defaultGraphPerms = graphPerms;
        }else{
            this.defaultGraphPerms = client.emptyGraphPerms();
        }
    }
290760
public ConfigOptionBuilder setDefaultWith( Object defaultValue ) {
        co.setHasDefault( true );
        co.setValue( defaultValue );
        return setOptional();
    }