Adds a DataSource

@param dataSource the data source, or {@code null}.
496684
void addDataSource(DataSource dataSource) {
		if (dataSource == null) return;
		this.dataSources.add(new DataSourceDefinition(dataSource.name(), dataSource.driverClass(), dataSource.url(), dataSource.username(), dataSource.password()));
	}
1121784
public static DataSource getDataSource(String source) {
		DataSource ds = dataSources.get(source);
		if (ds == null){
			synchronized (dataSourcesStructureLock){
				ds = dataSources.get(source);
				if (ds == null){
					ds = createDataSource(source);
					if (ds != null){
						dataSources.put(source, ds);
					}
				}
			}
		}
		return ds;
	}
306156
public BUILDER setDataSourceSupplier(@Nullable Supplier<DataSource<IMAGE>> dataSourceSupplier) {
    mDataSourceSupplier = dataSourceSupplier;
    return getThis();
  }
1313299
public static DataSource createDataSource(String url) throws SQLException {
        assertNotNull(url);

        BasicDataSource ds = new BasicDataSource();
        ds.setUrl(url);

        return ds;
    }
497014
private void addDatasourceIfNeeded(ServletRequest req)
            throws JspException
    {
        if (_match == null)
            return;

        for (int i = 0; i < _match.length; i++) {
            if (!_optionList.contains(_match[i])) {
                if (!_match[i].equals(NULL_VALUE))
                    addOption(req, _match[i], _match[i]);
            }
        }
    }
1271823
@NonNull
    public static Join crossJoin(@NonNull DataSource datasource) {
        if (datasource == null) {
            throw new IllegalArgumentException("datasource cannot be null.");
        }
        return new Join(Type.CROSS, datasource);
    }
1251661
public void setSourceIdsList(java.util.Collection<String> sourceIdsList) {
        if (sourceIdsList == null) {
            this.sourceIdsList = null;
            return;
        }

        this.sourceIdsList = new java.util.ArrayList<String>(sourceIdsList);
    }
1246418
public MetadataBuilder addDataSource(@NotNull InputStream dataSource, String path, boolean closeAfterBuild) {
    checkHashingResultIsNotSet();
    filesPaths.add(path);
    dataSources.add(new StreamBasedHolderImpl(dataSource, closeAfterBuild));
    return this;
  }
1341977
public static DataSource createDataSource(String source, String type, String config){
		DataSourceProvider dsp = dataSourceProviders.get(type);
		if (dsp == null){
			log.error("Unknown data source type for '" + source + "': " + type);
			return null;
		}
		
		DataSource ds = null;
		ds = dsp.createDataSource(source, config);
		if (ds != null){
			log.info("Data source created for: " + source);
		}else{
			log.error("Creation of data source failed for: " + source);
		}
		
		return ds;
	}
907028
public void addSource(GVRAudioSource audioSource)
    {
        synchronized (mAudioSources)
        {
            if (!mAudioSources.contains(audioSource))
            {
                audioSource.setListener(this);
                mAudioSources.add(audioSource);
            }
        }
    }
1314518
public static DataSource createDataSource(String source, String type, String... configs){
		String config = StringUtils.join(configs, " ");
		return createDataSource(source, type, config);
	}
1260912
public void addSchemaSource(Source s) {
        sources.add(s);
        validator.setSchemaSources(sources.toArray(new Source[0]));
    }
481153
def add(source):
    
    new_data = DatasetClient().add_data(source)
    print_data([DataClient().get(new_data['data_id'])])
796990
public static void addSource(SourceBuilder code, AnnotationMirror annotation) {
    new ValueSourceAdder(code).visitAnnotation(annotation, null);
  }
539021
@NonNull
    @Override
    public From from(@NonNull DataSource dataSource) {
        if (dataSource == null) {
            throw new IllegalArgumentException("dataSource cannot be null.");
        }
        return new From(this, dataSource);
    }
1079905
public MetadataBuilder addDataSource(@NotNull InputStream dataSource, String path) {
    addDataSource(dataSource, path, true);
    return this;
  }
479654
protected final <T> T createDataSource(Class<T> dataSourceClass) throws SQLException {
		if (getRealDataSourceClassName() == null) {
			throw new SQLException("Property realDataSourceClassName is not set");
		}
		try {
			T ds = dataSourceClass.cast(Class.forName(realDataSourceClassName).newInstance());
			for (Method m : ds.getClass().getMethods()) {
				String methodName = m.getName();
				if (methodName.startsWith("set") && m.getParameterTypes().length == 1) {
					final Object propertyValue;
					if (methodName.equals("setUser")) {
						propertyValue = getUser();
					} else if (methodName.equals("setPassword")) {
						propertyValue = getPassword();
					} else if (methodName.equalsIgnoreCase("setUrl")) {
						propertyValue = getRealUrl();
					} else if (methodName.equals("setLogWriter")) {
						propertyValue = getLogWriter();
					} else if (methodName.equals("setLoginTimeout")) {
						propertyValue = getLoginTimeout();
					} else {
						String propertyName = methodName.substring(3, 4).toLowerCase();
						if (methodName.length() > 4) {
							propertyName += methodName.substring(4);
						}
						final Class<?> propertyType = m.getParameterTypes()[0];
						propertyValue = getPropertyAs(propertyName, propertyType);
					}
					if (propertyValue != null) {
						m.invoke(ds, propertyValue);
					}
				}
			}
			return ds;

		} catch (Exception e) {
			throw new SQLException(e);
		}
	}