Returns a copy of the given configuration.
@param configuration the object to copy.
@since 2.6
171169
Configuration copy(Configuration configuration) {
    Configuration copy = new Configuration();
    copy.restoreState(configuration);
    return copy;
  }
296910
public ServerConfiguration copy() throws IOException {
        ReadableByteArrayOutputStream out = new ReadableByteArrayOutputStream();
        serialize(out);
        return new ServerConfigurationParser(out.toInputStream()).parse();
    }
766876
public void configure(String configuration)
        throws IOException
    {

        URL url=Resource.newResource(configuration).getURL();
        if (_configuration!=null && _configuration.equals(url.toString()))
            return;
        if (_configuration!=null)
            throw new IllegalStateException("Already configured with "+_configuration);
        try
        {
            XmlConfiguration config=new XmlConfiguration(url);
            _configuration=url.toString();
            config.configure(this);
        }
        catch(IOException e)
        {
            throw e;
        }
        catch(Exception e)
        {
            log.warn(LogSupport.EXCEPTION,e);
            throw new IOException("Jetty configuration problem: "+e);
        }
    }
1011468
public void storeState(final Configuration configuration) {
        // clear properties from vertex program
        Set<String> oldKeys = new HashSet<>();
        configuration.subset(PREFIX_SELECTED_TYPE_KEY).getKeys()
                .forEachRemaining(key -> oldKeys.add(PREFIX_SELECTED_TYPE_KEY + "." + key));
        oldKeys.forEach(configuration::clearProperty);

        // store selectedTypes
        selectedTypes.forEach(typeId ->
                configuration.addProperty(PREFIX_SELECTED_TYPE_KEY + "." + typeId, typeId));

        // store user specified properties
        persistentProperties.forEach((key, value) ->
                configuration.addProperty(PREFIX_PERSISTENT_PROPERTIES + "." + key, value));
    }
1178271
public String serialize(String name, Configuration configuration) {
      try {
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         serialize(os, name, configuration);
         return os.toString("UTF-8");
      } catch (Exception e) {
         throw new CacheConfigurationException(e);
      }
   }
909448
public ActionExecutionInput withConfiguration(java.util.Map<String, String> configuration) {
        setConfiguration(configuration);
        return this;
    }
1315751
public final static String process(final InputStream input, final Configuration configuration) throws IOException
    {
        final Processor p = new Processor(new BufferedReader(new InputStreamReader(input, configuration.encoding)),
                configuration);
        return p.process();
    }
604609
protected T injectCredentials(T configuration) {
        T oldConfig = findConfiguration(configuration.getName()).orElse(null);
        T target;
        if (StringUtils.isBlank(configuration.getPassword())) {
            if (oldConfig != null && StringUtils.equals(oldConfig.getUser(), configuration.getUser())) {
                target = configuration.withPassword(oldConfig.getPassword());
            } else {
                target = configuration;
            }
        } else {
            target = configuration;
        }
        return target;
    }
680169
private ConfigBuilder copyConfigBuilder() {
    return configBuilder()
        .withReader(config.reader())
        .withWriter(config.writer())
        .withConnectionFactory(config.connectionFactory())
        .withCommandHandler(config.commandHandler())
        .withPropertyHandler(config.propertyHandler())
        .withEnv(config.env());
  }
193320
public void expand(Configuration configuration) {
        OperationIterator it = this.problem.getOperationIterator(configuration);
        while (it.hasNext()) {
            Configuration c = it.next().execute(configuration);
            if (!this.queue.testPresence(c)) this.queue.add(c);
        }
    }
680686
public void setConfiguredProperties(BeanConfiguration configuration) {
        boolean changed = false;
        final Set<ConfiguredPropertyDescriptor> properties = getDescriptor().getConfiguredProperties();
        for (ConfiguredPropertyDescriptor property : properties) {
            final Object value = configuration.getProperty(property);
            final boolean changedValue = setConfiguredPropertyIfChanged(property, value);
            if (changedValue) {
                changed = true;
            }
        }
        if (changed) {
            onConfigurationChanged();
        }
    }
856693
public static void performCopy(String filename, SarlConfiguration configuration) {
		if (filename.isEmpty()) {
			return;
		}

		try {
			final DocFile fromfile = DocFile.createFileForInput(configuration, filename);
			final DocPath path = DocPath.create(fromfile.getName());
			final DocFile toFile = DocFile.createFileForOutput(configuration, path);
			if (toFile.isSameFile(fromfile)) {
				return;
			}
			configuration.message.notice((SourcePosition) null,
					"doclet.Copying_File_0_To_File_1", //$NON-NLS-1$
					fromfile.toString(), path.getPath());
			toFile.copyFile(fromfile);
		} catch (IOException exc) {
			configuration.message.error((SourcePosition) null,
					"doclet.perform_copy_exception_encountered", //$NON-NLS-1$
					exc.toString());
			throw new DocletAbortException(exc);
		}
	}
698630
public synchronized void storeConfiguration(Configuration configuration) {
    log.trace("Store configuration {}", configuration);
    byte[] bytes = serializer.encode(configuration);
    configurationBuffer.position(0)
        .writeByte(1)
        .writeInt(bytes.length)
        .write(bytes);
    configurationBuffer.flush();
  }
274630
@RequestMapping(value = "configurations/{name:.*}", method = RequestMethod.GET)
    public SVNConfiguration getConfiguration(@PathVariable String name) {
        return svnConfigurationService.getConfiguration(name);
    }
954010
public static HierarchicalConfiguration getHierarchicalConfiguration(final Configuration configuration) {
        if (configuration instanceof CompositeConfiguration) {
            final CompositeConfiguration compositeConfig = (CompositeConfiguration) configuration;
            for (int i = 0; i < compositeConfig.getNumberOfConfigurations(); i++) {
                if (compositeConfig.getConfiguration(i) instanceof HierarchicalConfiguration) {
                    return (HierarchicalConfiguration) compositeConfig.getConfiguration(i);
                }
            }
        }
        // maybe I need to send a runtime exception ??
        // throw new
        // ConfigurationRuntimeException("no hierarchical configuration was defined");
        return null;
    }
626028
public String resolve( Map<String, String> configuration )
    {
        StringBuilder buffer = new StringBuilder();
        append( buffer, configuration, null );
        return buffer.toString();
    }
98499
public static Config newConfig(String confName) {
        Config c = new Config();
        c.parse(confName);
        return c;
    }