Get the list of codecs listed in the configuration
@param conf the configuration to look in
@return a list of the Configuration classes or null if the attribute
was not set
178329
public static List<Class<? extends CompressionCodec>> getCodecClasses(Configuration conf) {
    String codecsString = conf.get("io.compression.codecs");
    if (codecsString != null) {
      List<Class<? extends CompressionCodec>> result
        = new ArrayList<Class<? extends CompressionCodec>>();
      StringTokenizer codecSplit = new StringTokenizer(codecsString, ",");
      while (codecSplit.hasMoreElements()) {
        String codecSubstring = codecSplit.nextToken();
        if (codecSubstring.length() != 0) {
          try {
            Class<?> cls = conf.getClassByName(codecSubstring);
            if (!CompressionCodec.class.isAssignableFrom(cls)) {
              throw new IllegalArgumentException("Class " + codecSubstring +
                                                 " is not a CompressionCodec");
            }
            result.add(cls.asSubclass(CompressionCodec.class));
          } catch (ClassNotFoundException ex) {
            throw new IllegalArgumentException("Compression codec " + 
                                               codecSubstring + " not found.",
                                               ex);
          }
        }
      }
      return result;
    } else {
      return null;
    }
  }
578509
private void initialize(Configuration configuration) {
    String[] codecClassNames = configuration.getTrimmedStrings(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES);
    List<Class> codecClasses = Lists.newArrayList();
    if (codecClassNames != null) {
      for (String clsName : codecClassNames) {
        try {
          codecClasses.add(Class.forName(clsName));
        } catch (ClassNotFoundException cnfe) {
          LOG.warn("Unable to load class configured for " + TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES
              + ": " + clsName, cnfe);
        }
      }
    }

    if (codecClasses.size() == 0) {
      codecClasses.addAll(Arrays.asList(TxConstants.Persist.DEFAULT_TX_SNAPHOT_CODEC_CLASSES));
    }
    for (Class<?> codecClass : codecClasses) {
      try {
        SnapshotCodec codec = (SnapshotCodec) (codecClass.newInstance());
        codecs.put(codec.getVersion(), codec);
        LOG.debug("Using snapshot codec {} for snapshots of version {}", codecClass.getName(), codec.getVersion());
      } catch (Exception e) {
        LOG.warn("Error instantiating snapshot codec {}. Skipping.", codecClass.getName(), e);
      }
    }
  }
1125856
public static String[] getListOfDataDirs(Configuration conf) {
    String[] configFilePath = conf.getStrings("dfs.datadir.confpath");
    String[] dataDirs = null;
    if(configFilePath != null && (configFilePath.length != 0)) {
      try {
        DataDirFileReader reader = new DataDirFileReader(configFilePath[0]);
        dataDirs = reader.getArrayOfCurrentDataDirectories();
        if(dataDirs == null) {
          LOG.warn("File is empty, using dfs.data.dir directories");
        }
      } catch (Exception e) {
        LOG.warn("Could not read file, using directories from dfs.data.dir" +
                                                         " Exception: ", e);
      }
    } else {
      LOG.warn("No dfs.datadir.confpath not defined, now using default " +
                                                              "directories");
    }
    if(dataDirs == null) {
      dataDirs = conf.getStrings("dfs.data.dir");
    }
    return dataDirs;

  }
708387
static ConverterFactory getConverterFactory(Configuration conf) {
    Class<? extends ConverterFactory> converterFactoryClass = conf.getClass(CONVERTER_FACTORY, null,
        ConverterFactory.class);
    if (converterFactoryClass == null) {
      throw new RuntimeException("ConverterFactory class was not set on the configuration");
    }
    LOG.debug("Got input ConverterFactory class from conf: {}", converterFactoryClass);
    return ReflectionUtils.newInstance(converterFactoryClass, conf);
  }
48384
private static List<String> toConfigurationStringList(final Configuration c) {
    final ConfigurationImpl conf = (ConfigurationImpl) c;
    final List<String> l = new ArrayList<>();
    for (final ClassNode<?> opt : conf.getBoundImplementations()) {
      l.add(opt.getFullName()
          + '='
          + escape(conf.getBoundImplementation(opt).getFullName()));
    }
    for (final ClassNode<?> opt : conf.getBoundConstructors()) {
      l.add(opt.getFullName()
          + '='
          + escape(conf.getBoundConstructor(opt).getFullName()));
    }
    for (final NamedParameterNode<?> opt : conf.getNamedParameters()) {
      l.add(opt.getFullName()
          + '='
          + escape(conf.getNamedParameter(opt)));
    }
    for (final ClassNode<?> cn : conf.getLegacyConstructors()) {
      final StringBuilder sb = new StringBuilder();
      join(sb, "-", conf.getLegacyConstructor(cn).getArgs());
      l.add(cn.getFullName()
          + escape('='
              + ConfigurationBuilderImpl.INIT
              + '('
              + sb.toString()
              + ')'
      ));
    }
    for (final NamedParameterNode<Set<?>> key : conf.getBoundSets()) {
      for (final Object value : conf.getBoundSet(key)) {
        final String val;
        if (value instanceof String) {
          val = (String) value;
        } else if (value instanceof Node) {
          val = ((Node) value).getFullName();
        } else {
          throw new IllegalStateException("The value bound to a given NamedParameterNode "
                  + key + " is neither the set of class hierarchy nodes nor strings.");
        }
        l.add(key.getFullName() + '=' + escape(val));
      }
    }
    return l;
  }
794193
protected List<String> resolveJavacOptions( CompilerConfiguration configuration )
    {
        String javacOptions = configuration.getJavacOptions();
        String sourceEncoding = configuration.getSourceEncoding();
        List<String> result = new ArrayList<String>( Arrays.asList( parseArgLine( javacOptions ) ) );
        if ( !result.contains( "-encoding" ) && sourceEncoding != null && sourceEncoding.length() > 0 )
        {
            result.add( "-encoding" );
            result.add( sourceEncoding );
        }
        return result;
    }
117425
public void setCodecs(List<String> codecs)
    {
        if (codecs == null || codecs.isEmpty())
        {
            this.codecs = null;
            return;
        }

        Iterator<String> iter = codecs.iterator();
        StringBuilder buffer = new StringBuilder(iter.next());
        while (iter.hasNext())
        {
            buffer.append(",").append(iter.next());
        }
        this.codecs = buffer.toString();
    }
252159
public static Codec getEncoderByName(String avCodecName) throws JavaAVException {
		if (avCodecName == null || avCodecName.isEmpty())
			throw new NullPointerException("Codec name is null or empty.");

		AVCodec avCodec = avcodec_find_encoder_by_name(avCodecName);

		if (avCodec == null || avCodec.isNull())
			throw new JavaAVException("Encoder not found: " + avCodecName);

		Codec codec = new Codec();
		codec.avCodec = avCodec;

		return codec;
	}
662624
private static Map<byte[], byte[]> createCfRenameMap(Configuration conf) {
    Map<byte[], byte[]> cfRenameMap = null;
    String allMappingsPropVal = conf.get(CF_RENAME_PROP);
    if(allMappingsPropVal != null) {
      // The conf value format should be sourceCf1:destCf1,sourceCf2:destCf2,...
      String[] allMappings = allMappingsPropVal.split(",");
      for (String mapping: allMappings) {
        if(cfRenameMap == null) {
            cfRenameMap = new TreeMap<byte[],byte[]>(Bytes.BYTES_COMPARATOR);
        }
        String [] srcAndDest = mapping.split(":");
        if(srcAndDest.length != 2) {
            continue;
        }
        cfRenameMap.put(srcAndDest[0].getBytes(), srcAndDest[1].getBytes());
      }
    }
    return cfRenameMap;
  }
137098
public static KeyRange getInputKeyRange(Configuration conf)
    {
        String str = conf.get(INPUT_KEYRANGE_CONFIG);
        return str == null ? null : keyRangeFromString(str);
    }
1248803
public void get_properties(AttributeConfig conf)
	{

//
// Copy mandatory properties
//

		conf.writable = writable;
		conf.data_format = data_format;
		conf.max_dim_x = max_x;
		conf.max_dim_y = max_y;
		conf.data_type = data_type;
		conf.name = name;

//
// Copy optional properties
//

		conf.label = label;
		conf.description = description;
		conf.unit = unit;
		conf.standard_unit = standard_unit;
		conf.display_unit = display_unit;
		conf.format = format;
		conf.writable_attr_name = writable_attr_name;
		conf.min_alarm = min_alarm_str;
		conf.max_alarm = max_alarm_str;
		conf.min_value = min_value_str;
		conf.max_value = max_value_str;
	
//
// No extension nowdays
//

		conf.extensions = new String[0];
	}
1012952
def _get_existing_conf(config):
    
    try:
        with open(os.path.join(config, 'local.conf'), 'r') as f:
            lines = [line for line in f.readlines()
                     if not (line.startswith('service_id') or line.startswith('client_secret'))]
    except IOError:
        lines = []
    return lines
1195763
public static Class<? extends CobolComplexType> getInputKeyRecordType(Configuration conf) {
      return conf.getClass(CONF_INPUT_KEY_RECORD_TYPE, null, CobolComplexType.class);
    }
136698
private List<StringKeyValueBean> loadConfiguration(){
		List<StringKeyValueBean> result = new LinkedList<StringKeyValueBean>();
		Resource resource = null;
		if (primaryConfigFileLocation == null){
			return result;		// fail silently because we must be in test
		}else{
			resource = new ClassPathResource(primaryConfigFileLocation);
			if (!resource.exists()){
				if (secondaryConfigFileLocation == null){
					return result;		// fail silently because we must be in test
				}
				resource = new ClassPathResource(secondaryConfigFileLocation);
			}
		}

		Properties properties = null;
		try {
			properties = PropertiesLoaderUtils.loadProperties(resource);
			
			// sort them, make the more specific ones at the top, and "*"/".*" at the bottom
			List<StringKeyValueBean> sorted = new ArrayList<StringKeyValueBean>(properties.size());
			for (Entry<Object, Object> entry: properties.entrySet()){
				sorted.add(new StringKeyValueBean(entry.getKey().toString(), entry.getValue().toString()));
			}
			Collections.sort(sorted, new Comparator<StringKeyValueBean>(){
				@Override
				public int compare(StringKeyValueBean b0,	StringKeyValueBean b1) {
					if (b0.getKey().equals(b1.getKey())){
						return 0;
					}
					if ("*".equals(b0.getKey()) || ".*".equals(b0.getKey())){
						return 1;
					}else if ("*".equals(b1.getKey()) || ".*".equals(b1.getKey())){
						return -1;
					}
					return b1.getKey().compareTo(b0.getKey());
				}
			});
			result.addAll(sorted);
		} catch (Exception e) {
			logger.warn("Cannot load environments configuration file from class path: " + 
					(resource == null ? "<null>" : resource.getDescription()), e);
		}
		
		return result;
	}
317574
private List<ConfigurationHelper.ConfigurationInfo<String>>
      getFilePathConfigurationListWithDefault(@Nullable List<String> filePaths,
       String defaultFilePath) {
    List<ConfigurationHelper.ConfigurationInfo<String>> defaultConfigList =
        ConfigurationHelper.newList(true, defaultFilePath);
    List<ConfigurationHelper.ConfigurationInfo<String>> filePathConfigList =
        ConfigurationHelper.newList(filePaths, true);
    if (defaultConfigList != null) {
      if (filePathConfigList == null) {
        filePathConfigList = defaultConfigList;
      } else {
        filePathConfigList.addAll(defaultConfigList);
      } 
    }
    return filePathConfigList;
  }
510682
private int compress(String argv[], Configuration conf) throws IOException {
    int i = 0;
    String cmd = argv[i++];
    String srcf = argv[i++];
    String dstf = argv[i++];

    Path srcPath = new Path(srcf);
    FileSystem srcFs = srcPath.getFileSystem(getConf());
    Path dstPath = new Path(dstf);
    FileSystem dstFs = dstPath.getFileSystem(getConf());

    // Create codec
    CompressionCodecFactory factory = new CompressionCodecFactory(conf);
    CompressionCodec codec = factory.getCodec(dstPath);
    if (codec == null) {
      System.err.println(cmd.substring(1) + ": cannot find compression codec for "
          + dstf);
      return 1;
    }

    // open input stream
    InputStream in = srcFs.open(srcPath);

    // Create compression stream
    OutputStream out = dstFs.create(dstPath);
    out = codec.createOutputStream(out);

    IOUtils.copyBytes(in, out, conf, true);

    return 0;
  }
376888
function getOptions(conf) {
  var parts = [];
  if(!conf.expansions && !conf.flags) {
    return parts;
  }
  var start = conf.start, end = conf.end;
  var sre = /^-[a-zA-Z0-9]$/, lre = /^--/;
  var chars = '';
  var lng = [];
  var opts = this.cmd._options, z, arg, names, i, options = [];
  for(z in opts) {
    arg = opts[z];
    if(arg.isFlag()) {
      names = arg.names();
      for(i = 0;i < names.length;i++) {
        if(conf.expansions && sre.test(names[i])) {
          chars += names[i].substr(1);
        }else if(conf.flags && !conf.combine && lre.test(names[i])) {
          lng.push(start + names[i] + end);
        }
      }
      if(conf.combine) {
        if(conf.no) {
          names = flutil.getNoExpansions(names);
        }
        lng.push(start + names.join('|') + end);
      }
    }else if(arg.isOption()){
      if(conf.options) {
        options.push(start + getOptionValue(arg, conf) + end);
      }
    }
  }
  var expansions = chars.length ? start + HYPHEN + chars + end : '';
  var commands = Object.keys(this.cmd._commands).length > 0;
  if(commands && conf.command && conf.prepend) {
    parts.push(conf.scommand
      + this.messages.usage.command + conf.ecommand);
  }
  if(expansions) {
    parts.push(expansions);
  }
  if(lng.length) {
    parts.push(lng.join(' '));
  }
  if(options.length) {
    parts.push(options.join(' '));
  }
  if(commands && conf.command && !conf.prepend) {
    parts.push(conf.scommand
      + this.messages.usage.command + conf.ecommand);
  }
  if(conf.args) {
    parts.push(conf.sargs
      + this.messages.usage.args + conf.eargs);
  }
  return parts;
}